• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp insert into database error(java.lang.NumberFormatException: For input string: "")

 
Sam Raoh
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am trying to insert data from a jsp form into a table when the user clicks the submit button. I am encountering this exception.

java.lang.NumberFormatException: For input string: "type"

Here is my code:

This is the code in the form jsp:


this is my code in the sign - up bean:



and this is my dbBean's insert method:




thank you very much. any help is greatly appreciated
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Er, when do you get the exception?
 
Sam Raoh
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dav. I got it working..

Since you asked. It was in the JSP page.

The solution was to use:

<option value = <%= type %>>< %= strName1 %></option>



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic