J
Jeff Taylor
I'm trying to separate the details of the input elements on my forms
from the form itself. In doing this, I am creating small JSPs for
things like a text fields and select/comboboxes and including them
into the main jsp. I'm running into a problem when the small jsps
need to access something like a list that is stored in the request
attributes. I want to pass the name of the attribute to the small jsp
like:
<jsp:include page="selectlist.jsp" flush="true">
<jsparam name="listname" value="mylist"/>
<jsparam name="fieldid" value="myselectlistname"/>
</jsp:include>
and then in selectlist.jsp
<SELECT name="${fieldid}" >
<c:forEach var="value" items="${listname}">
<OPTION value="${value.code}">${value.display}</OPTION>
</c:forEach>
</SELECT>
The values get passed correctly, but I need the items= to evaluate to
the list, not the name of the list. I tried adding an extra set of
${} around the ${listname}, but that didn't work too well. Is there
any way to cause a double-evaluation of the EL parameters? I have all
the proper taglib includes and this works if it is in my main jsp, but
I want to have the level of indirection.
I'm using Tomcat 5.0.16 and have the JSP 2.0 information enabled along
with the EL enabled.
Thanks,
Jeff
from the form itself. In doing this, I am creating small JSPs for
things like a text fields and select/comboboxes and including them
into the main jsp. I'm running into a problem when the small jsps
need to access something like a list that is stored in the request
attributes. I want to pass the name of the attribute to the small jsp
like:
<jsp:include page="selectlist.jsp" flush="true">
<jsparam name="listname" value="mylist"/>
<jsparam name="fieldid" value="myselectlistname"/>
</jsp:include>
and then in selectlist.jsp
<SELECT name="${fieldid}" >
<c:forEach var="value" items="${listname}">
<OPTION value="${value.code}">${value.display}</OPTION>
</c:forEach>
</SELECT>
The values get passed correctly, but I need the items= to evaluate to
the list, not the name of the list. I tried adding an extra set of
${} around the ${listname}, but that didn't work too well. Is there
any way to cause a double-evaluation of the EL parameters? I have all
the proper taglib includes and this works if it is in my main jsp, but
I want to have the level of indirection.
I'm using Tomcat 5.0.16 and have the JSP 2.0 information enabled along
with the EL enabled.
Thanks,
Jeff