It depends on lots of things: what PopulationStrategy are you using, how
does your JSP look like, whether you are using a custom error handler or the
sourcePage parameter is being used, whether you are using a redirect in
between or not… Can you show us some of your code?

 

Something like the following works as you expect:

 

 

JSP

 

<s:form beanclass="my.PersistDepartmentAction">

  <label for="department.name">Name</label> <s:text name="department.name"
/><s:errors field="department.name" />

  <s:submit name="persist">Persist</s:submit>

</s:form>

 

 

Action

 

public class PersistDepartmentAction extends BaseAction {

 

  @ValidateNestedProperties(@Validate(field="name",required=true))

  private Department department;

 

  public Resolution execute() {

    // do something...

    return new RedirectResolution(ListDepartmentsAction.class);

  }

}

 

 

  _____  

De: [email protected] [mailto:[email protected]] 
Enviado el: miércoles, 25 de marzo de 2009 10:35
Para: [email protected]
Asunto: [Stripes-users] Validation vs. updating model

 


Hi, 

I've run into a problem with validation. It'd be great with a friendly nudge
in the right direction if it's possible to change this behaviour. 

Let's say I have a form with two fields - A and B. These are both required. 

If I fill A, but not B, and then submit I (correctly) get the error message
that B is required. But after the reload my value entered in A is lost. It
does not seem to be set on the bean. 

Am I doing something wrong, or could I affect this behaviour somehow? 

Thanks, 

-dennis 

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to