• Post Reply Bookmark Topic Watch Topic
  • New Topic

Array Iteration in JSP  RSS feed

 
Deepan Ignatius
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is it possible to itearate over a string array set in session scope within JSP without using scriptlets?

code example:



Now I want to iterate over the above session attribute in JSP. How to do that?

Thanks.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can go for forEach loop of JSTL!
 
Rajkamal Pillai
Ranch Hand
Posts: 445
1
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use custom tags.
Use the name of the Attribute with the scope set to session.

Cheers,
Raj.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raj Kamal wrote:You can use custom tags.

Why re-invent the wheel and use a custom tag rather that JSTL's <c:forEach>?
 
Deepan Ignatius
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Done this using JSTL and EL. Thanks for your response.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepan Ignatius wrote:Done this using JSTL and EL. Thanks for your response.

you are welcome.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!