JSP: Nested expression language expressions and Spring

L

Lord0

Hi there,

We're having a bit of trouble "nesting" Expression Language
expressions:

### in our jsp
### slab:input is a tag we've written

<td align="left">
<slab:input path="solsRef" />
</td>

### the slab:input tag

<%@ tag body-content="scriptless" %>
<%@ attribute name="path" required="true" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<font color="red">
<b><form:errors path="${path}"/></b>
</font>
<c:choose>
<c:when test="${mode == 'view'}">
${path}
</c:when>
<c:eek:therwise>
<form:input path="${path}" />
</c:eek:therwise>
</c:choose>

### end the tag

So what we're trying to do is if the mode is "view" then just display
a, non-editable, value otherwise use the Spring form:input tag to
construct an HTML <input> element, properly populated.

The generation of the input element works okay but trying to display
the data in "view mode" displays the value of $path AND NOT the $path
property from the command object.

Cheers

Lord0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top