Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • 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:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

getting java.lang.NumberFormatException  RSS feed

 
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: 63435
205
  • 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: 3931
45
  • 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: 67241
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Become a Java guru with IntelliJ IDEA
https://www.jetbrains.com/idea/
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!