You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Apoorva Rais (JIRA)" <ji...@apache.org> on 2008/12/28 05:33:38 UTC

[jira] Created: (STR-3177) Subclassed forms share same parent instance even after creating new instance of all child form classes

Subclassed forms share same parent instance even after creating new instance of all child form classes
------------------------------------------------------------------------------------------------------

                 Key: STR-3177
                 URL: https://issues.apache.org/struts/browse/STR-3177
             Project: Struts 1
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.3.9
         Environment: N/A
            Reporter: Apoorva Rais


I have a Parent form class that extends ActionForm and has some common attributes that are shared by all the modules of the application.  I have multiple child forms based on module with their own action handlers. The issue is that only one instance of the parent form class gets created and is shared across all child forms.

Ex:  ParentForm extends ActionForm and Now I have ModuleForm1 and ModuleForm2 which both extend ParentForm. In this scenario only one instance of ParentForm gets created and is shared for ModuleForm1 and ModuleForm2. Is this by design? Is there a way to avoid it?




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (STR-3177) Subclassed forms share same parent instance even after creating new instance of all child form classes

Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/STR-3177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45386#action_45386 ] 

Paul Benedict commented on STR-3177:
------------------------------------

This is an impossible situation. A parent form isn't a separate object when the child is instantiated.

> Subclassed forms share same parent instance even after creating new instance of all child form classes
> ------------------------------------------------------------------------------------------------------
>
>                 Key: STR-3177
>                 URL: https://issues.apache.org/struts/browse/STR-3177
>             Project: Struts 1
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.3.9
>         Environment: N/A
>            Reporter: Apoorva Rais
>
> I have a Parent form class that extends ActionForm and has some common attributes that are shared by all the modules of the application.  I have multiple child forms based on module with their own action handlers. The issue is that only one instance of the parent form class gets created and is shared across all child forms.
> Ex:  ParentForm extends ActionForm and Now I have ModuleForm1 and ModuleForm2 which both extend ParentForm. In this scenario only one instance of ParentForm gets created and is shared for ModuleForm1 and ModuleForm2. Is this by design? Is there a way to avoid it?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.