Results 1 to 5 of 5

Thread: ${status.expression} does not work

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Posts
    17

    Default ${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. #2
    Join Date
    Aug 2004
    Location
    Sydney
    Posts
    503

    Default

    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.

  3. #3
    Join Date
    Aug 2004
    Location
    Boston MA
    Posts
    27

    Default 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

  4. #4
    Join Date
    Aug 2004
    Location
    Denver
    Posts
    249

    Default

    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

  5. #5
    Join Date
    Jan 2005
    Posts
    17

    Default

    Quote 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!

Similar Threads

  1. Replies: 1
    Last Post: Jul 7th, 2005, 03:49 PM
  2. Getting Locale to work.
    By solasta in forum Web
    Replies: 5
    Last Post: Jun 3rd, 2005, 11:04 AM
  3. Channel and message transformation question
    By Alarmnummer in forum Architecture
    Replies: 12
    Last Post: May 11th, 2005, 05:06 PM
  4. Replies: 3
    Last Post: Dec 22nd, 2004, 02:30 PM
  5. Spring can't work on Eclipse
    By ryanhowai in forum Architecture
    Replies: 1
    Last Post: Nov 9th, 2004, 06:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •