Announcement Announcement Module
Collapse
No announcement yet.
${status.expression} does not work Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ${status.expression} does not work

    I hope no one feels offended if I post that much newbie questions but I'm at a point where I don't get any further without help.

    In previouse posts people suggested me to use ${status.expression} instead the name it self. It actually did not solve my problem I posted before but I have another problem.

    I currently use following code which returns me the disered values from the user

    Code:
    <spring&#58;bind path="user.user.username"> 
    					<input type="text" name="username" value="$&#123;user.user.username&#125;"/> 
    					<span class="fieldError">$&#123;status.errorMessage&#125;</span> 
    				</spring&#58;bind>
    But if I use status.expression instead the value and the name attribute in the input tag is empty - so it does not work with user.expression but with the fix name username it works!
    Code:
    <spring&#58;bind path="user.user.username">
    	               <input type="text" name="<c&#58;out value="$&#123;status.expression&#125;"/>" value="<c&#58;out value="$&#123;status.value&#125;"/>">
    	               <span class="fieldError">$&#123;status.errorMessage&#125;</span>
    	            </spring&#58;bind>
    This should work both way!? Shouldn't it?

  • #2
    try

    name="<spring:message text='${status.expression}'/>" value="<spring:message text='${status.value}'/>"

    i think you may need to wrap <spring:message> around the ${status.expression/value} usages.

    Comment


    • #3
      Command Class

      Can I see the full code of your command class, JSP page and the definition of the controller from your *-servlet.xml file?


      Keller

      Comment


      • #4
        If you're using a Servlet 2.4 container (with a 2.4 web.xml), you shouldn't need <c:out>. Try this:

        Code:
        <spring&#58;bind path="user.user.username">
            <input type="text" name="$&#123;status.expression&#125;" value="$&#123;status.value&#125;"/>
            <span class="fieldError">$&#123;status.errorMessage&#125;</span>
        </spring&#58;bind>
        Are you user.user.username is the correct path? That means that you have a getUser() in your User object...

        Matt

        Comment


        • #5
          Originally posted by mraible
          If you're using a Servlet 2.4 container (with a 2.4 web.xml), you shouldn't need <c:out>. Try this:

          Code:
          <spring&#58;bind path="user.user.username">
              <input type="text" name="$&#123;status.expression&#125;" value="$&#123;status.value&#125;"/>
              <span class="fieldError">$&#123;status.errorMessage&#125;</span>
          </spring&#58;bind>
          Are you user.user.username is the correct path? That means that you have a getUser() in your User object...

          Matt
          Thanks for all the answears! I found the problem! I did not include the spring.tld!!!

          The strange thing about it is that I never got an error message! Like above spring:bind worked in some constelations without having the spring.tld included!

          Comment

          Working...
          X