Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Scriptlet to JSTL

 
Ola Daniel
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use the following code on my JSP:


I want to convert the above to JSTL and avoid the use of scriptlets on the page.
The challenge is how do I convert the foolowing part of the code to JSTL.


I hope my question is clear.
 
Ola Daniel
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not so sure my question above is clear. What I mean is how can i use JSTL
to so something like this:

where index is a variable.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Ola Daniel
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ben thanks for the tutorial link, but i dont need help with the <c:forEach> Tag. What i need help with is the JSTL equivalent of this code:

request.getAttribute("analy"+index+"_code_options")
where index is a variable.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ola Daniel:

where index is a variable.


What kind of variable? A scriptlet variable or a scoped variable?

If the former, why are you mixing JSTL/EL and scriptlets?

If the latter, then something like:



will do the trick.
[ January 17, 2006: Message edited by: Bear Bibeault ]
 
Ola Daniel
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear, its the latter.

Your post solvs my problem. Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic