• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to provide server side validation in servlets with JSP

 
jagadeesh indukuri
Greenhorn
Posts: 28
Java MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to know what is the best way for server side validation in servlets with JSP


Thanks In advance

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean doing validations on your JSP? What do you mean by Servlets with JSP? A JSP in the end is a Servlet!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe Harry wrote:A JSP in the end is a Servlet!

Yes, but that's really an irrelevant detail.

To the OP, what specifically are you having trouble with? Your question is too vague to evoke a meaningful answer.
 
jagadeesh indukuri
Greenhorn
Posts: 28
Java MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe Harry wrote:Do you mean doing validations on your JSP? What do you mean by Servlets with JSP? A JSP in the end is a Servlet!



ok, How to validate a form using servlets i.e what i'm expecting.Now I think so you are understand my question
 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay. You write code which examines the inputs (which would be the URL parameters) and checks to see if they match your business requirements, which should already have been documented. If they do not, then presumably you notify the user of that -- the way to do that should also already have been documented. Does that help?
 
jagadeesh indukuri
Greenhorn
Posts: 28
Java MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:Okay. You write code which examines the inputs (which would be the URL parameters) and checks to see if they match your business requirements, which should already have been documented. If they do not, then presumably you notify the user of that -- the way to do that should also already have been documented. Does that help?



Yes paul. I want solution for that one
 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use the standardized Bean Validation 1.1 API. You'd need a Java SE 7 (or EE 7) environment, like a recent Tomcat version, and the Hibernate Validator 5 reference implementation. It's a pretty powerful approach to declarative and reusable validation that can work in different layers of an application.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!