Results 1 to 2 of 2
  1. #1
    raghavanjm is offline Member
    Join Date
    May 2010
    Location
    Chennai
    Posts
    1
    Rep Power
    0

    Default Need help in JSTL <c:set>

    Dear All,
    I have one requirement, where i need to set variable name dynamically while looping.
    i need to set variable name as level1,level2,level3,level4 and assign values while looping.So that i used,
    <c:set var="level${status.count}" value="${currentLevel}" /> but it is not working.
    My full code is ,

    Java Code:
    <c:forEach items="${levels}" var="currentLevel" varStatus="status" begin="0" end="5">
        level<c:out value="${status.count}" /> is
        <c:out value="${currentLevel}" />
        <br />	
       <c:set var="level${status.count}" value="${currentLevel}" />   
        <c:out value="level${status.count}"/>
    </c:forEach>
    Please help me.:(
    Last edited by raghavanjm; 05-24-2010 at 04:25 PM. Reason: code part not proper

  2. #2
    flyfisherman is offline Member
    Join Date
    Mar 2010
    Posts
    26
    Rep Power
    0

    Default

    Quote Originally Posted by raghavanjm View Post
    Please help me.:(
    Maybe I will but after you learn how to use CODE tags.... All I see is just a bunch of smiles...

Similar Threads

  1. Jstl
    By prakashkadakol in forum New To Java
    Replies: 10
    Last Post: 01-13-2010, 08:17 PM
  2. JSTL && NullPointerException
    By berlindutza in forum JavaServer Pages (JSP) and JSTL
    Replies: 7
    Last Post: 01-12-2010, 06:43 PM
  3. Why are we using JSTL in jsp?
    By makpandian in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 06-30-2009, 11:15 PM
  4. jstl tag <if>
    By subha in forum Advanced Java
    Replies: 1
    Last Post: 04-02-2009, 10:07 PM
  5. jstl in jsp
    By nagaprasanna in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 11-18-2008, 09:18 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •