This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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: 64633
86
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