#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Location
    Ottawa, Ontario
    Posts
    50
    Rep Power
    13

    Question passing values from scriplets to tags


    hi, I wonder how to pass values from scriplets to any tags - custom or standard:

    <%! String customers = "one,two,three"; %>

    <c:forEach var="customer" items="${customers}">
    <c: out value="${customer}"/><br>
    </c:forEach>

    doesn't work, ${customers} is null when I access it outside <%%>

    I am sure there is some simple way...
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Location
    Ottawa, Ontario
    Posts
    50
    Rep Power
    13
    I got it:

    <%
    String customers = "one,two,three";
    pageContext.setAttribute("customers", customers, pageContext.APPLICATION_SCOPE);
    %>

IMN logo majestic logo threadwatch logo seochat tools logo