struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Benedict (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STR-3177) Subclassed forms share same parent instance even after creating new instance of all child form classes
Date Sun, 28 Dec 2008 06:33:36 GMT

    [ 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.


Mime
View raw message