Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to user Server Side validation in JSP pages?

 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

I have a Registration Form in which I am registering user to perform some sort like Entering messages I want to perform some Server Side validation.

Like suppose a user has Enter an Id then as soon as he start entering the Id then I want that this Id should be checked in database that if this Id exists in database or not.

and similar types of validation I want to apply on other fields to.

How can I acheive this?


Thanks
 
Aditya Karnad
Greenhorn
Posts: 16
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The example you present can be implemented using AJAX. You can check it out at the W3schools site. They have some good training material there with examples.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be sure to use jQuery to do your Ajax (and other complicated JavaScript actions). It will save you a lot of headaches, and a lot of code.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And to be a bit pedantic about it: you don't do thins in "JSP pages" -- the JSPs are just templates for the HTML pages that are generated. So you're actually doing this from HTML pages (that just happen to be generated from JSP).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!