Why no c:while tag in JSTL? Alternatives?

Hi there.
I am a bit surprised there is no <c:while> tag in the JSTL. For example while outputting a list I want to be able to do this:
<c:while test="${currLevel < level--}"></ul></c:while>
But of course I can't.
Can anyone tell me:
1. How to do this in JSTL
2. Why the JSTL designers in their infinite wisdom didn't implement a <c:while> tag

Problem already solved, but I think that answer to question number 2, why while tag is not implemented, may be because you cannot deliver expressions to tag handlers as parameters. Parameters are always solved before they are delivered to handlers.
For example, if you put some boolean expression to JSP tag parameter,
<c:while test="${ a!=b }">
expression "a!=b" is solved once and the value is sent to handler, so it will be infinity loop or nothing at all.
How while loop may be implemented in JSP would be(for example) something like this.
<do>
<while test="${ a!=b }"/> <%-- no end tag --%>
<content>
do something...
</content>
</do>
While-tag gets value from boolean expression and sets that value to parent do-tag, content-tag asks from parent do-tag is it allowed to evaluate it's content.
Now expression "a!=b" gets evaluated in every iteration.
Quick thoughts,
and sorry for bad english.

Similar Messages

  • Why we use tablib uri in JSTL?

    I am confused with this
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    the uri attribute is pointing to a web folder. why we use this if we install JSTL jar files in our web application directry to use it?
    what if we dont have internet connection, will it throw an error because in that case it wont be able to point to given uri?
    second question is------
    if we achieve functionalities using JSTL tags only then why we use xml tags in JSTL?

    Surrounded wrote:
    I am confused with this
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    the uri attribute is pointing to a web folder. why we use this if we install JSTL jar files in our web application directry to use it?To avoid unnecessary imports. You can compare it less or more with "import" statement in raw Java code.
    what if we dont have internet connection, will it throw an error because in that case it wont be able to point to given uri?URI != URL. Plug off your network cable and retest. Does it crash? Think logically. I must however confess that it has been a poor choice to let them start with "http://". This introduces unnecessary confusion among starters. You has been not the only one who was wondering that way.
    second question is------
    if we achieve functionalities using JSTL tags only then why we use xml tags in JSTL?I don't understand you.

  • Why don't my tags show up when re-saving a document that I previously tagged?

    I love the idea of tags. I use them religiously in Lightroom to organize and recall my photos. The one thing that makes tags ineffective though is the amount of effort it takes to enter them. But being a true believer of the value I do it. That being said, the way Apple has implemented tags is driving me nuts.
    I create a document
    I click save
    I enter a name and
    I enter tags  - BTY I wish I could expand the tagging window to see all the tags I have entered and all the tags that are available
    Later I make changes to my document and I want to add tags so I selected save as
    PROBLEM - All the tags that I previously saved with this document are gone. I have to renter them.  This is horrible!
    Why don't my tags show up when re-saving a document that I previously tagged? Is there anyway to get my Mac to recognize that I previously tagged this file and display my tags?
    If not, APPLE PLEASE FIX SOON.

    Christian3D
    Adobe Lightroom issues are best posted in the Adobe forums - not an Apple issue to be addressed, even though it is occurring in a OSX 'Save Dialog'.
    CCC

  • How to use sql tag of jstl for inserting data

    hello
    I want to insert the data in to oracle through jsp using standard sql tags of jstl please help me

    1) Go to www.google.com.
    2) Enter in that input field "jstl sql tag tutorial" (assuming you want to learn the JSTL SQL tag library).
    3) Hit that search button.
    4) Explore the results. One of them is http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSTL7.html

  • Struts tags versus JSTL tags

    Hi all,
    I'm trying to determine the performance and code generation differences between Struts and JSTL tags. Currently I have a very large JSP which is part of a Struts based application and it's teethering on the edge of the 'code too large for method' issue.
    Would replacing Struts based tags with JSTL tags reduce the amount of code generated in a jspService method for a JSP? For example replacing
    logic:equal or logic:match with c:if test="..."
    I would appreciate anyone opinion on this.
    Thanks,
    Paul

    Thanks,
    We've already followed those guidelines. It's really more to do a decision by our functional design team who decided to combine the functionality of two pages into one, which is something we should have flagged initially.
    Now we are left with this task of attempting to optimise. It's not the
    perfect solution.
    There is heavy use of logic:equal/match tags throughout the JSP and my initial investigation is that a c:if test="..." seems to generate less
    lines of code because there are not as many attributes to set on the
    object.
    Would anyone agree with me on that?
    Thanks,
    Paul

  • Why dot1Q doesn't tag native vlan?

    Why dot1Q doesn't tag native vlan?
    Is there any reason? Or Is there any advantage with this ?
    Regards,
    Chandu

    Chandu
    The native vlan is there to support connectivity to switches that do not support vlan tagging so that if the switch on the other end of the link cannot interpret frames with vlan tags added it can still process the non tagged native vlan packets.
    Nowadays most, if not all, switches do understand vlan tagging so it is very rare you need it for it's original purpose and you can in fact on a lot of Cisco switches actually tell the switch to tag the native vlan as well.
    Jon

  • Can we use logical Operator in C:When  tag of JSTL

    Hi,
    I am developing an application in JSTL.
    I am using c:when tag. I have question whether can we use Logical OR operator in JSTL.
    I have tried using the following Syntax: The two bean fields have the value DISABLED
    <c:set var="testval" value = "${bean.val}" />
    <c:set var="testvalue" value ="${bean.value}" />
    Ex: <c:when test="${testval eq 'DISABLED'} or ${testvalue eq 'DISABLED'}">
    Ex: <c:when test="${(testval eq 'DISABLED') or (testvalue eq 'DISABLED')}">
    Ex: <c:when test="${testval eq 'DISABLED' or testvalue eq 'DISABLED'}">
    retrieving both these values from bean.
    The following syntaxes did not work.
    Please give me some pointers to resolve the issue.
    Thanks,
    Ravi
    Edited by: user10977303 on Nov 17, 2010 9:05 AM
    Edited by: user10977303 on Nov 17, 2010 9:10 AM

    The entire expression including the 'or' has to be inside the ${}.
    What this has to do with error handling beats me.

  • Why do actor/director tags not appear on iPad via home sharing?

    I have imported some movies (not purchased from iTunes) into iTunes, and added tags. The movies play perfectly in iTunes, and via home sharing on my iPad, iPhone, and Apple TV 2. The strange thing is that some of the tags (actors, director) don't display on the iPad when looking at the movie info in the Videos app. They do display on the Apple TV and in iTunes.
    Any ideas why this would be so? I know that iTunes movie rentals do display such information on the iPad, so it doesn't seem like this is just not a supported feature.

    Also, to expand a bit on this, the list of actors also shows on my iPhone if I touch and hold the name of the movie. So, it seems only the iPad is not getting it.

  • Why,  after a while, Itunes on my PC can't read anymore Ipad?

    Why, still after around 15 months from the purcvhase, after a while, Itunes on my PC( win7) can't read anymore Ipad and the only way to make it work is reinstalling completely Itunes once again?
    I tried the proceeding suggested on the help online( cleaning the previous installation deleting some folder and so on): no way.
    Thank you

    The stores menu is at the very top Along with
    File, Edit, View, Controls, Store, Window, Help
    You want Store > Authorise this computer.
    It is not inside the iTunes Store

  • Why can't show result in JSTL?

    I use Tomcat5.0 . The resulting output of the preceding code fragment is $9,000 ,but it show nothing in IE. Why?
    <%@ taglib uri='http://java.sun.com/jstl/fmt' prefix='fmt'%>
    <c:set var='originalMonetaryAmount' value='$10,000'/>
    <fmt:parseNumber value='${originalMonetaryAmount}' var='parsedAmount' type='currency' parseLocale='en-US'/>
    <c:set var='result' value='${parsedAmount - 1000}'/>
    <fmt:setLocale value='en-US'/>
    <fmt:formatNumber value='${result}' type='currency'/>

    Hi,
    If you are using tomcat, try using another container, resin for instance.
    I'm having almost the same situation were tomcat does not display anything in browser(but errors are displayed through standard output console) and resin displays what expected.
    I havent found out why, I read something about JVM < 1.4.2_07 and actually I havent been answered about this.
    Regards,
    OO

  • Why is the "iPhone" tag no longer working in My Contacts, just "mobile"?

    I went into My Contacts to add a number and to add some new contacts. It no longer gives me the option to tag a phone as "iPhone". It only gives you the option of "mobile".
    Older contacts that I created in the past have the tag of "iPhone", but I can find no way to change it on the new contacts.
    Does anyone know why or how I can fix it?

    Mavericks will be fine- just don't update Pages, Numbers, or Keynote to the new versions.
    Pages 4.3 should still be in an iWorks folder within your Applications folder when you upgrade to Mavericks (which IS actually an upgrade, unlike the iWorks apps).
    Please remember to tell Apple what we need from them at:
    http://www.apple.com/feedback/pages.html

  • HTML tags amidst JSTL

    I am trying to print a text in bold, using the following code:
    <logic:present name="letterGenerationForm" property="arlTemplateHeader" >
    <logic:iterate name="letterGenerationForm" property="arlTemplateHeader" id="headerValues" >
    <b><bean:write name="headerValues"/></b>
    </logic:iterate>
    </logic:present>As seen, i want the output to be in bold! however, the text prints also with the HTML bold tags. as eg, o/p is: <b>TEXT FROM BEAN:WRITE</b>
    Is there a workaround to format the text coming from bean:write?

    I am trying to print a text in bold, using the
    following code:
    <logic:present name="letterGenerationForm"
    property="arlTemplateHeader" >
    <logic:iterate name="letterGenerationForm"
    property="arlTemplateHeader" id="headerValues" >
    <b><bean:write name="headerValues"/></b>
    </logic:iterate>
    </logic:present>As seen, i want the output to be in bold! however,
    the text prints also with the HTML bold tags. as eg,
    o/p is: <b>TEXT FROM BEAN:WRITE</b>
    Is there a workaround to format the text coming from
    bean:write?A better way would be to use CSS for formatting.
    JSTL might be better.
    %

  • Why is the fn: tag being ignored everywhere?

    Just trying to see if is useful... why do all the articles on taglibs ignore the fn: taglib? Even the IDE I use - borland JBuilder ignores it completely in its code assitance...
    Any particular reason?

    The fn: taglib is new with JSP 2.0 (JSTL 1.1). Most of the tutorials out there (and most of the servers out there last I checked) work with JSTL 1.0 which did not have the function library.

  • Why some extra XML tags are created when viewed a XML in Adobe Illustrator with Esko plugin?

    We see some extra XML tags are created when viewing a XML in Adobe Illustrator with Esko plugin. Why these extra lines are created ?
    Screenshot of XML and XML viewed in AI below(the extra XML tags outlined in red):

    Hi Graffiti,
    Thanks so much for your resply.  I am happy to say that the problem has been fixed by my customer updating her version of Adobe Reader 9 to the latest version.  I had sent her a few suggestions on how to try to fix the problem including that one from info I had read on the forum etc.. and that was the solution that worked.  I am so relieved that I was able to fix the problem and to answer your question the blank pages were only graphics no text but they were the only pages that the graphics took up the whole page.  I thought that was strange and had her change a setting in preferences for printing large images a solution I read in the forum but it did not work.   

  • ITunes 10.4 performance issue while tagging

    After switching to the 64bit version of iTunes I experience a much worse performance when tagging songs compared to the 32bit version. Changing some values (like comments or genre) of ten songs can take a few minutes. I got a very large library of about 150,000 songs, but this doesn't explain the loss in performance because it used to work better before. Is it some kind of new ID3-format or what could slower the performance?

    No suggestions, but I appear to be having the same issue: batch changing a bunch of content is suddenly taking a minute or two. I'm having flashbacks to the aged notebook I retired about a year back.
    (I'm getting this with iTunes ten point four and OSX ten point six point eight... and now I need to figure out why the heck trying to type a number in Safari is suddenly sending me to different tabs! That's new...)

Maybe you are looking for

  • How to know the error in the goods movement

    Hai gurus, a) while doing goods issue and goods receipt , if there is any     error  in the goods movement how to know the same and correct it. Regards, sekar chand

  • Want to add and remove GL account in report through report painter

    Hi, Thanks in advance, 1.I want to add new GL account in IS01 report i.e. Income Statement. I am trying to add through report painter but could not able to do it. 2.Also i want to delete existing GL account from report through report painter. Any bod

  • Problem with symbol euro

    Hi, I have a problem with xml publisher when i used a symbol euro (€). I have a ? in my output. Have you an solution ? Thank you

  • Lot size dependent / independent

    Hi, please advise when the system uses this lot size times data in mrp4 view? Where we need to specify that whether lot size dependent or independent need to select? When the system uses this data and when the system uses the planned delivery days an

  • Visio 2007 Error 126

    The exact error I am getting is: "An error (126) occurred during th eaction Save As. Visio cannot save the file you selected." whenever a user tries to do a "Save As" of a file into a network directory. They can do a save as if it's on their own comp