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>
<ctherwise>
<form:input path="${path}" />
</ctherwise>
</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
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>
<ctherwise>
<form:input path="${path}" />
</ctherwise>
</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