aspose file tools*
The moose likes JSP and the fly likes have problem with multiple forms on a jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "have problem with multiple forms on a jsp" Watch "have problem with multiple forms on a jsp" New topic

have problem with multiple forms on a jsp

harsha galla

Joined: Sep 24, 2008
Posts: 18
i have different forms on a single jsp and the code goes like this:

i have jquerey for accordion and tabs..each accordion opens to give a form which refers a servlet at backend..

i get the following error when i try filling a form and submit it:

java.lang.NumberFormatException: For input string: ""
Steve Luke

Joined: Jan 28, 2003
Posts: 4180

I actually see only one form on there - as delineated by <form> </form> tags. So you don't have multiple forms. If you want multiple forms, you will need to put each one in their own set of form tags and give each one their own submit button.

The error tells you that you are trying to pull out a value for a field and turn it into a number, but the field was not entered by the user. So you have to validate the form (at least check that all required fields were entered) and respond to the client that there are missing values if they haven't filled the form out completely.

I agree. Here's the link:
subject: have problem with multiple forms on a jsp