• Post Reply Bookmark Topic Watch Topic
  • New Topic

NumberFormatException in JSP  RSS feed

 
sachin yadav
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a jsp where i am using a custom tag.



In offer.java OFFER_ID is Integer type and in taglib class i have it as



I am getting exception:



i have already tried <%=((Offer.Offer_id).intValue())%> and parseint ect. but no use. Any help would be appreciated.
 
Frank Eichfelder
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you set rtexprvalue to true in your tld?
 
Omar Al Kababji
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are getting this wrong because your tag is reading <%=Offer.OFFER_ID%> as a string and not evaluating it, try putting something as a number for example "2" and take a look that its working. if yes then you have to specify that your columnId property can receive a runtime expression in the tld as Frank said ;)
 
sachin yadav
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try to put a number like '2' in place of <%=Offer.OFFER_ID%> and that is working. My tld xml is like.




Now what to do as soon as i put <%=Offer.OFFER_ID%> i got an error
 
Omar Al Kababji
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok the problem is in the <%=Offer.OFFER_ID%> try replacing it with a real run time expression using EL ${Offer.OFFER_ID}
 
sachin yadav
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is working now, thanks man
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!