How perform validation and display error message in same form in JSP?

前端 未结 3 788
广开言路
广开言路 2020-11-22 15:43

How can I display an error message in the very same JSP when a user submits a wrong input? I do not intend to throw an exception and show an error page.

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-22 16:09

    I see tag "form-validation", so maybe you should just use JavaScript and client form validation? If you need validation with JSP, handle form data, and redisplay the form with an error message or accept form data, if it's correct.

提交回复
热议问题