aspose file tools*
The moose likes JSP and the fly likes Simple jsp form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Simple jsp form " Watch "Simple jsp form " New topic
Author

Simple jsp form

Suresh Khant
Ranch Hand

Joined: Feb 27, 2010
Posts: 118
Hi All ,

I am newbie to jsp I have created the following form with bean

index.jsp



Person.java



I have the following questions

1) is my above way to put the form and the processing in a single page is a right way or i have to make separation for that or there is another better way to do that ?
2) how to show the errors if there are some empty submitted fields and I want to tell the user to fill them ?
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
It is generally accepted that you submit a request to a servlet for java code handling, and use JSPs only for rendering the view (MVC)

I would actually recommend using a web framework which has supporting code that does the heavy lifting for things such as:
- mapping/converting parameters to beans
- validation of the bean and redisplay of the page(with errors) if necessary
- encourages you to use an MVC approach

Common examples are Struts, Stripes, JSF.
Personally I prefer Stripes right now, but there are a bunch of other out there I don't know about.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple jsp form
 
Similar Threads
Form processing using register.java but it doesn't show my hashmap errormessages
Calling Java Bean from JSP
error occuring while use jsp
how the values added from two different browsers can be seen in either of the browsers?
JavaMail won't send mail