Results 1 to 4 of 4

Thread: Spring webflow 2 binding: nested object do not follow flow rule

  1. #1
    Join Date
    May 2012
    Posts
    6

    Default Spring webflow 2 binding: nested object do not follow flow rule

    I have an object that has a nested one that is binded in the same view:

    Code:
        class MyForm{
           private String var1;
           private String var2;
           private MyNestedForm nested;
        }
        
        class MyNestedForm{
           private String var3;
        }

    and in my jsp:

    Code:
       <form:input path="var1" /> 
        <form:input path="var2" /> 
        <form:input path="nested.var3"/>
    As I enter some value in var1 and var2 in my form everything goes well (validations, prev/back buttons...)
    But var3 maintain always the last value inserted! Even if I restart the flow from the beginning

    Do I missing something?

    Many thanks for your help.

  2. #2
    Join Date
    May 2012
    Posts
    6

    Default

    Does anyone knows what's missing?
    the complex model I'm using works fine all the attributes EXCEPT for nested objects! Is this a norbal behaviour?
    Is it normal that a nested boject is not cleared among different executions?

  3. #3
    Join Date
    Jul 2012
    Posts
    2

    Default

    Hi Marcoa,
    Did you solved the problem? I am currently stuck with the same issue

  4. #4
    Join Date
    May 2012
    Posts
    6

    Default

    Quote Originally Posted by hiro View Post
    Hi Marcoa,
    Did you solved the problem? I am currently stuck with the same issue
    Hello, I did not go on searching more to find the best solution for this problem (I had other ones more important I had to solve first), but eventually I attempted to solve the problem with two solutions:
    1- (less engineered): I placed an @Scope("session") annotation into the nested class
    2- I've extended the flow with a new form to fill the nested object.

    hope it helps

    Marco.

Posting Permissions

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