How is user validation done in J2ee pages?
In a login page, password should be v开发者_Python百科alidated using Database. I need the same page to appear if the authentication fails, just like in GMAIL. How is it done ? Should I use AJAX (or) RequestDispatcher in Servlets (or) Cookies (or) any other way?
Which is the traditional way ??
Use an MVC framework with validation capability. Here a list of well known MVC frameworks:
- Struts 2 (http://struts.apache.org/)
- Spring MVC (http://www.springsource.org/about)
Both of them support validations.
You might want to look into JSR-303 validation. There are several good blogs on the web explaining with examples, here's one of them: http://blog.inflinx.com/2010/03/10/jsr-303-bean-validation-using-spring-3/.
精彩评论