• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Iterate tag

 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Y do I get the following values when I use the iterate tag

${ul.firstName} ${ul.lastName}

Inside the iterate tag, I use the follwing EL

<c ut value="${ul.firstName}"/>  <c ut value="${ul.lastName}"/>

At runtime its displaying the above results

Thx in advance
 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check if the tag lib is mentioned at the top of the JSP.

-Seshu
 
Mary Cole
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it is mentioned.....

<%@ taglib uri="/WEB-INF/lib/c.tld" prefix="c" %>
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Inside a logic:iterate tag?

Well, the logic:iterate sets its value (id) as a Java reference variable. As far as I know, JSTL only communicates with variables set to pageContext.

Try using a c:forEach to achieve the iterating functionality. c:forEach will set its values to pageContext so the c ut tags can read them.

Worse case scenario you can use bean:write instead of c ut... but I'd rather lead you towards JSTL and away from bean and logic tags.
 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've heard/been told to stay away from EL, because the performance is rather poor, something about every single page view requiring a compilation. I like using the struts tags, I've used a few of the JSTL tags, but anytime I've used EL I've been kind of put off by tryning to get the EL variables to work with any other scripting variables.

Is there any truth to the poor performance? and is there any easy way to get the EL variables to work with other scripting variables?

-Tad
 
Marc Peabody
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Tad Dicks:
Is there any truth to the poor performance? and is there any easy way to get the EL variables to work with other scripting variables?



The performance shouldn't be any worse than the Struts tags. Every page view does not require compilation, although if it did that WOULD be horrible on performance. If you want it to work well with scripting variables you'll have to set them to context:
pageContext.setAttribute("myVariable", myVariable);

You should be able to accomplish just about everything you could need without using scriptlets. If you avoid scriptlets & logic/bean tags, this context/compatability becomes a non-issue.
 
Mary Cole
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got it working with the Struts Iterate tag and the bean:write
But when am building the list ,every row has a check box and I need to associate the value of the firstname with that checkbox so that I can delete that particualr name from DB.
How can I do using <html:checkbox
 
Mary Cole
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pls its urgent
 
Marc Peabody
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your question is large in scope. I recommend consulting the Struts user guide for help with the use of html:checkbox, try out what you can, and if you absolutely can't figure it out go ahead and post your progress with a request for some help. Otherwise, it looks like you are asking others to do your work for you without putting any effort in it yourself.
 
Beauty is in the eye of the tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic