Results 1 to 5 of 5

Thread: <form:errors path=""/> doesn't work with webflow+mvc...?

  1. #1
    Join Date
    Jul 2005
    Posts
    111

    Default <form:errors path=""/> doesn't work with webflow+mvc...?

    i'm experiencing a situation with swf 2.3 and mvc 3.0.5 where i am not seeing form level errors (validation errors associated at the class level v. a property level) when using:

    Code:
    <form:errors path=""/>
    yet i will see the information dumped using the more verbose syntax:

    Code:
    <spring:hasBindErrors name="${commandName}">
    				<div class="error">
    					<spring:bind path="${commandName}.*">
    						<span><c:out value="errors=${errors}" /> </span>
    						<c:forEach items="${errors.allErrors}" var="error">
    							<span><c:out value="error=${error}" /> </span>
    							<br />
    						</c:forEach>
    					</spring:bind>
    				</div>
    			</spring:hasBindErrors>
    as an aside, the <form:errors> syntax in an identical jsp file works flawlessly in plain old spring mvc minus webflow.

    is this by design or is this a bug of sorts?

    thanks,
    tony.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,629

    Default

    Your path expression is empty... You should use a * in the path expression...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Jul 2005
    Posts
    111

    Default

    hi martin,

    i'm trying to get only the form level validation errors. if i use path="*", i get both form and field level errors...

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,629

    Default

    Hmm I'm not aware that the path without a * should even work if it works it is probably not so by design. Also the verbose syntax should also display the field errors and not only the form errors (as you desribe them) it will only be visible if there are only form errors...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5
    Join Date
    Jul 2005
    Posts
    111

    Default

    mmm, i've always used <form:errors path=""/> in spring-mvc to get errors not associated with a particular field. you're thinking it's an unsupported coincidence that it works?
    if that's the case, what do you suggest as the "best practice" for getting errors not associated with a specific field?

Posting Permissions

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