This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with one EL  RSS feed

 
priyanka jolly
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am facung a problem writing an EL.
Actually in the servlet code in am setting in the request something like
request.setAttribute("ABC"+Constants.Key);The value for this is a list.I need to iterate over it an print the result.

Now how can i retrieve it in the jsp using EL.I am stuck how to write the items attribute for it in c:forEach.

Please help
 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think this is

did try you [CODE]Value of request attribute is :- ${ABC}

-P
[ June 06, 2008: Message edited by: Praful Thakare ]
 
priyanka jolly
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh I am sorry i mean in the servlet the attribute is set as

request.setAttribute("ABC"+Constants.key,Object)

And this object is a list
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66184
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this for information on avoiding wasting people's time with "red herrings". If you waste people's time, they will soon learn to avoid your posts.
[ June 06, 2008: Message edited by: Bear Bibeault ]
 
Marimuthu Madasamy
Ranch Hand
Posts: 72
Java Monad Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cant access a Java class constant in EL because it is not exposed to any web contexts( request, session.. scopes). Hence you should use the direct lookup value like,



or else you can write an utility class/Custom tag which will expose the constants of a class to any web context
or you can use 'unstandard' tag library (useConstants tag) from Apache.

Hope this helps.
[ June 09, 2008: Message edited by: Marimuthu Madasamy ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66184
146
IntelliJ IDE Java jQuery Mac Mac OS X
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!