• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL code error  RSS feed

 
kumar mahesh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • 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
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
I found out the error. Thanks for your reply.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!