JSP: Nested expression language expressions and Spring

Discussion in 'Java' started by Lord0, Jan 15, 2007.

  1. Lord0

    Lord0 Guest

    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
     
    Lord0, Jan 15, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Taylor

    JSP include and expression language

    Jeff Taylor, Apr 6, 2004, in forum: Java
    Replies:
    0
    Views:
    568
    Jeff Taylor
    Apr 6, 2004
  2. Rhino
    Replies:
    2
    Views:
    6,170
    James McGill
    Feb 24, 2006
  3. Replies:
    0
    Views:
    4,419
  4. rmn190
    Replies:
    2
    Views:
    2,379
    Arne Vajhøj
    Jan 10, 2008
  5. Goldfish
    Replies:
    1
    Views:
    732
    Goldfish
    Nov 6, 2008
Loading...

Share This Page