Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

[JSTL] how can I convert values (string to int) in JSTL

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I would like to give an expression "3-${i}" to c:forEach end, and I got the following error

javax.servlet.jsp.el.ELException: An exception occured trying to convert String "3-1" to type "java.lang.Integer"
at org.apache.commons.el.Logger.logError(Logger.java:481)

..... the actual code is

<c:set var="i" value="1" />

<c:forEach var="j" begin="1" end="3-${i}" step="1">
<c:out value="${j}" /><br />
</c:forEach>
......

How can I solve this issue ?

Thanks in advance.

cscsaba

 
Sheriff
Posts: 6619
1253
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"csaba cs", please check your private messages regarding an important administrative matter.
 
Marshal
Posts: 67415
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Csaba Szegedi
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

thanks really, i was lost sorry

Bear Bibeault wrote:

 
    Bookmark Topic Watch Topic
  • New Topic