• Post Reply Bookmark Topic Watch Topic
  • New Topic

regarding jsp validation  RSS feed

 
S Kazi
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends ,
i have writtern two pages in jsp in 1st page i have written input fields and in another fields i have written validation whenver on submit button i have written the onSubmit=valid.jsp but i want it in same page i should i do it

Thanks
[ January 02, 2009: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Firstly, you should be doing data processing such as validation in a servlet, not a JSP. Modern JSPs should have no Java code within them.

Secondly, you cannot validate the data in the same JSP that creates the page. The JSP is executed in order to send the resulting HTML page to the browser. How could it possibly validate data that hasn't yet been entered by the user?

If that still has you confused, please read this article to understand how JSPs work.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!