• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JSTL code error

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,

I am new to JSTL and currenlty working on it. I am getting the below exception when i invoke the JSP.

java.lang.NumberFormatException: For input string: "$noRows"

CODE:

JSP:
<c:if test="${(displaySize - noRows) gt 0}">
<tr >
<td><!--<a href="javascript:generate_prevChannel_js()" >
<img src="images/arrow_up.png" alt="Previous Channels"/>
</a> -->
</td>
</tr>
</c:if>

SErvlet:

session.setAttribute("displaySize", 10);
session.setAttribute("noRows",10);

BOth the displaySize and noRows are session attributes and are numbers. Will the EL inside the test automatically convert the session variable string to numbers and perform the subtraction?

Kindly reply.

Regards,
mahesh
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

kumar mahesh wrote: Will the EL inside the test automatically convert the session variable string to numbers and perform the subtraction?



Yes. nothing wrong with your notation . i doubt on your session setAttribute value. please check that. and also use code tag to post your code
 
kumar mahesh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found out the error. Thanks for your reply.
 
Let me tell you a story about a man named Jed. He made this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic