POJO means Plain Old Java Object. Our Simple Java class which contains variable declaration and getter and setter method with no argument constructor that is our POJO class.
Generally MVC model flow like
Jsp --> Servlet -- > Servlet call your business logic which is your java class then Servlet get result from business class --> finally Servlet pass to jsp.
So servlet serve as Controller.
Java Class represent Business logic.
Jsp contains view Part.
Frank Eichfelder
Ranch Hand
Joined: Aug 25, 2003
Posts: 33
posted
0
For more specific validation concerns, you should perhaps consider to use a validation framework, e. g. Commons Validator.
Nitin Belaram
Ranch Hand
Joined: Mar 24, 2009
Posts: 67
posted
0
Nishan Patel wrote:
Hi,
POJO means Plain Old Java Object. Our Simple Java class which contains variable declaration and getter and setter method with no argument constructor that is our POJO class.
Generally MVC model flow like
Jsp --> Servlet -- > Servlet call your business logic which is your java class then Servlet get result from business class --> finally Servlet pass to jsp.
So servlet serve as Controller.
Java Class represent Business logic.
Jsp contains view Part.
hi please suggest how to implement the validation in servlet as we do in jsp with javascript function ,if possible give example
Nitin Bombay wrote: hi please suggest how to implement the validation in servlet as we do in jsp with javascript function
jsp is used for the view purpose . so use javascript in jsp rather than servlet .just if you want to know, already ankit mentioned above that how to display data from servlet
If you want to suggestion for business logic then use same way as Ankit Garg says.
But make another POJO Class for your business logic.
Make object of that class and call method which contains all your business logic.
So, that is good practice for development and you are using MVC architect for development.
Then don't use HTML code in your Servlet make one separate jsp which contains basically your view part.
From the servlet make one requestdispatcher object and call forward method which pass your request to jsp and display it.
As I said, it was a very basic example .
Coming to the question, you can't validate a whole form in javascript. Usually we validate form values for correctness using javascript like checking the length of fields etc.
And I think you must go through the tutorial that I gave which shows a complete example using the strategies that Nishan is referring to...
Thanks for suggestion, But i want to check validation for inserting data into database .the value need to be insert from Jsp and validation( such as allow only string ,allow only numeric value) need to be check in servlet .please suggest with example
"Nitin Bombay " please check your private messages for an important administrative matter. You can check them by clicking the My Private Messages link above.
Thanks for suggestion, But i want to check validation for inserting data into database .the value need to be insert from Jsp and validation( such as allow only string ,allow only numeric value) need to be check in servlet .please suggest with example
Thanks for suggestion, But i want to check validation for inserting data into database .the value need to be insert from Jsp and validation( such as allow only string ,allow only numeric value) need to be check in servlet .please suggest with example
That's already covered.
Please suggest how to insert data from jsp form .As in the tutorial no jsp page is given
"Nitin Bombay " please check your private messages for an important administrative matter. You can check them by clicking the My Private Messages link above.
Thanks for suggestion, But i want to check validation for inserting data into database .the value need to be insert from Jsp and validation( such as allow only string ,allow only numeric value) need to be check in servlet .please suggest with example
That's already covered.
Please suggest how to insert data from jsp form .As in the tutorial no jsp page is given
Hi any one please suggest how to insert data from jsp form via using this example(tutorial) As no jsp page is given .