• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

getting java.lang.NumberFormatException

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my code so far and also i m new in jsp servlet.




This is servlet code:

 
robin Morshed
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now i m getting java.lang.NumberFormatException: For input string: "" error
 
Marshal
Posts: 66949
255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is that the empty String? It cannot be turned into a number You didn't say where that is happening, but you might be getting text from a text component which hasn't been filled in yet. It shows you that users can be relied upon to find a way to pass wrong input ; you will have to find a way to stop them.
 
robin Morshed
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what i am trying to do is i want to give user an ooption to chose date and month from the drop down list which came from database and also day too. once the chose the month,year and day then i want to get that value and combine all and convert into a date..but for some reason when i am chosing year and month its not taking. where did i do wrong?
 
Rancher
Posts: 4399
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if you're not providing a day value then what is this line going to parse?


Also, you really should not have any Java code in a JSP page like that.
 
Marshal
Posts: 67334
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:Also, you really should not have any Java code in a JSP page like that.


Indeed, doing so has been obsolete since 2001! Please read this article for info on properly structuring Java web applications.
 
Not so fast naughty spawn! I want you to know about
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!