You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Stuart Goldberg (JIRA)" <ji...@apache.org> on 2006/11/08 16:03:57 UTC

[jira] Created: (STR-2972) LazyValidatorForm cannot be saved in the session

LazyValidatorForm cannot be saved in the session
------------------------------------------------

                 Key: STR-2972
                 URL: http://issues.apache.org/struts/browse/STR-2972
             Project: Struts 1
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.3.5
         Environment: N/A
            Reporter: Stuart Goldberg


This issue relates to the Struts Bugzilla entry "ASF Bugzilla Bug 35488".

That fix makes it so that your forms can be resued if you use a POJO in a <form-bean> element that Strus will wrap in a BeanValidatorForm.

However it is still broken in the following scenario. Use LazyValidatorForm (or a subclass thereof) in a <form-bean> element. Your form will never be reused (or saved?) because FormBeanConfig will compare LazyValidatorForm against LazyDynaBean and always fail.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (STR-2972) LazyValidatorForm cannot be saved in the session

Posted by "Stuart Goldberg (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/STR-2972?page=comments#action_38673 ] 
            
Stuart Goldberg commented on STR-2972:
--------------------------------------

Thanks Niall,

I see from the Struts website that you are a committee member. Well, I now have my name is lights!

Anyway, my company uses Struts and was enhancing one of our project's code. I found the LazyValidatorForm to be very useful for what I wanted to do.

However, I would have prefered a flavor that doesn't seem to exist.

Here's the scenario, we have one of 4 forms that can put up as a web page. Each of the forms has a certain number of fields in common; the others vary from form to form. If this were modeled in OOP terms, you'd have an abstract form that has the common fields and subclasses that add their own.

I'm looking for a type of Struts form that, in part, looks like a POJO ActionForm with setters and getters, yet it would have a lazy component to it as well so that other fields could be added to it much like the LazyValidatorForm.

I'd like to be able to pull out the common information like this: myForm.getCommonProp1(), myForm.getCommonProp2(), etc. I'd like to reserve the lazy usage pattern (i.e. myForm.get("specialProp1") ) for the specialized properties. I tried to compose something like this using: LazyDynaBean, WrapDynaBean, subclassing, etc. All to no avail!

Do you see something useful in this? Perhaps I could write it and become a Contributer! Let me know.

- Stuart



> LazyValidatorForm cannot be saved in the session
> ------------------------------------------------
>
>                 Key: STR-2972
>                 URL: http://issues.apache.org/struts/browse/STR-2972
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.3.5
>         Environment: N/A
>            Reporter: Stuart Goldberg
>
> This issue relates to the Struts Bugzilla entry "ASF Bugzilla Bug 35488".
> That fix makes it so that your forms can be resued if you use a POJO in a <form-bean> element that Strus will wrap in a BeanValidatorForm.
> However it is still broken in the following scenario. Use LazyValidatorForm (or a subclass thereof) in a <form-bean> element. Your form will never be reused (or saved?) because FormBeanConfig will compare LazyValidatorForm against LazyDynaBean and always fail.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (STR-2972) LazyValidatorForm cannot be saved in the session

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/STR-2972?page=all ]

Niall Pemberton resolved STR-2972.
----------------------------------

    Fix Version/s: 1.3.6
       Resolution: Fixed
         Assignee: Niall Pemberton

Hi Paul,
resolving this as fixed.

Stuart,
in Struts 1.3 you can inherit "dyna" forms using the "extends" attribute - maybe that will meet your need? One possible issue with what you describe is how beanutils treats DynaBeans and POJO's - if its a DynaBean then any regular properties are ignored. Possiblly I have mis-understood - if you do come up with an alternative implementation that you want to share with others then by all means open a Jira ticket and submit it back.

> LazyValidatorForm cannot be saved in the session
> ------------------------------------------------
>
>                 Key: STR-2972
>                 URL: http://issues.apache.org/struts/browse/STR-2972
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.3.5
>         Environment: N/A
>            Reporter: Stuart Goldberg
>         Assigned To: Niall Pemberton
>             Fix For: 1.3.6
>
>
> This issue relates to the Struts Bugzilla entry "ASF Bugzilla Bug 35488".
> That fix makes it so that your forms can be resued if you use a POJO in a <form-bean> element that Strus will wrap in a BeanValidatorForm.
> However it is still broken in the following scenario. Use LazyValidatorForm (or a subclass thereof) in a <form-bean> element. Your form will never be reused (or saved?) because FormBeanConfig will compare LazyValidatorForm against LazyDynaBean and always fail.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (STR-2972) LazyValidatorForm cannot be saved in the session

Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/STR-2972?page=comments#action_38781 ] 
            
Paul Benedict commented on STR-2972:
------------------------------------

Niall, If this is fixed, I would like to assign this to 1.3.6 and resolve it. Are you finished with it?

> LazyValidatorForm cannot be saved in the session
> ------------------------------------------------
>
>                 Key: STR-2972
>                 URL: http://issues.apache.org/struts/browse/STR-2972
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.3.5
>         Environment: N/A
>            Reporter: Stuart Goldberg
>
> This issue relates to the Struts Bugzilla entry "ASF Bugzilla Bug 35488".
> That fix makes it so that your forms can be resued if you use a POJO in a <form-bean> element that Strus will wrap in a BeanValidatorForm.
> However it is still broken in the following scenario. Use LazyValidatorForm (or a subclass thereof) in a <form-bean> element. Your form will never be reused (or saved?) because FormBeanConfig will compare LazyValidatorForm against LazyDynaBean and always fail.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (STR-2972) LazyValidatorForm cannot be saved in the session

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/STR-2972?page=comments#action_38638 ] 
            
Niall Pemberton commented on STR-2972:
--------------------------------------

Fixed in revision 472728, thanks for reporting this.

   http://svn.apache.org/viewvc?view=rev&revision=472728

If you need a workaround you could create your own FormBeanConfig implementation, modify it to correctly recognise session scoped LazyValidatorForm that can be reused and configure Struts to use your FormBeanConfig implementation.

This issue and the related bug STR-2507 could probably do with back-porting to the 1.2.x branch.

Niall

> LazyValidatorForm cannot be saved in the session
> ------------------------------------------------
>
>                 Key: STR-2972
>                 URL: http://issues.apache.org/struts/browse/STR-2972
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.3.5
>         Environment: N/A
>            Reporter: Stuart Goldberg
>
> This issue relates to the Struts Bugzilla entry "ASF Bugzilla Bug 35488".
> That fix makes it so that your forms can be resued if you use a POJO in a <form-bean> element that Strus will wrap in a BeanValidatorForm.
> However it is still broken in the following scenario. Use LazyValidatorForm (or a subclass thereof) in a <form-bean> element. Your form will never be reused (or saved?) because FormBeanConfig will compare LazyValidatorForm against LazyDynaBean and always fail.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira