>>>>> "Vincent" == Vincent Peytavin <[EMAIL PROTECTED]> writes:

    Vincent> Hello,
    Vincent> I've a new question on the use of forEach tag :
    Vincent> I've put object (DeviceList) in session user, but under a key which 
defined
    Vincent> by a constant (Constant.MY_C). And the same thing for a dates table (under
    Vincent> Constant.TAB_DATES).

    Vincent> And i don't know how to write my forEach loop because of these constants.

    Vincent> I'd like to do stg like this :
    Vincent> <c:forEach var="my_device" items="${<%=Constant.MY_C%>}"
    Vincent> varStatus="index_device">
    Vincent>     <c:out value="${my_device.name}"/>
    Vincent>     <br>
    Vincent>     <c:out value="${<%=Constant.TAB_DATES%>}[i_appareil.index]}"/>
    Vincent> </c:forEach>

    Vincent> What's wrong? Where can i find explanation about what goes where?

Well, that's a new one.  I never thought someone would think to mangle an EL
expression in quite that way :) .

You need to read the JSTL specification, if you haven't yet.  That will
hopefully make it clear what you can and cannot do in an EL expression.

In particular, EL expressions and expression scriptlets are not mixed, not in
the attributes for a single tag, and certainly not within the same attribute
value.

Also, the EL can reference javabean properties, and map/collection/array
entries.  Nothing more.  If you need to reference constant values, you can have
your Action or Servlet code put your constants into a bean in some scope.  This
particular issue has been discussed numerous times on this list.

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP; SCWCD




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to