This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to avoid numberformat Exception

 
sudhan reddy
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
this is madhu.i done one appilication.
where i connected html page to servlets.
in html page if i dont give any values for the inputs it throws numberformat exception which i dont want to throw the excepition and i want just leave that cloumn empty and continue the remaing code.that is it should not bouther whether we have given all data to the html page and should take only the given data and display the output
 
Chris Beckey
Ranch Hand
Posts: 116
Eclipse IDE Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wherever you are doing the parsing (from String to numeric) wrap it with a try..catch(NumberFormatException) and then ignore the exception (or, more likely, set the numeric to a default value). something like:
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic