• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Problem with c:forEach tag

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wrote like this..
< html:select property="frame">
< c:forEach var="frame" items="${frame_list}">
< html ption value="${frame.id}"
< c ut value="${frame.frameName}" />
</ html ption>
</ c:forEach>
</ html:select>

But value is coming as ${frame.id} instead of actual value..

Any one help me?

Thanks in advance.
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check that your deployment descriptor declares a servlet specification of 2.4 and not 2.3. EL is disabled with version 2.3 by default.

Also, which container are you using? Before Tomcat 5.x (JSP 2.0), EL was not (required to be) supported by the container itself but was usually found in tags like <c ut>.

EDIT: 1. Take a look at the JSP FAQs, it explains what I said in detail : http://faq.javaranch.com/java/ElOrJstlNotWorkingAsExpected

2. You've posted in the wrong forum, this isn't a servlet question, it's about JSPs/ JSTL. You should've posted it here.
[ September 28, 2007: Message edited by: Tarun Yadav ]
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Mahalingaiah HR", please check your private messages for an important message from me.

Also, please take the time to choose the correct forum for your posts. This forum is for questions on servlets.

This post has been moved to a more appropriate forum.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Struts, you can avoid a lot of JSP code by learning to use the Struts custom tags. The html:optionsCollection tag would be very useful in this situation. Example:

[ September 28, 2007: Message edited by: Merrill Higginson ]
 
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Merrill, I always prefer to use the JSTL tags if possible before using the Struts tags. Is there an equivalent JSTL tag or JSTL way of doing this?

Thanks
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Like you, I prefer to to use JSTL tags over Struts tags when they are equivalent and both do essentially the same job. However, in this case, there is no JSTL solution that can do the job as well as the Struts tags. Your only option with JSTL is by looping through the list similar to the code in the first post in this thread.
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks
 
You will always be treated with dignity. Now, strip naked, get on the probulator and hold this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic