You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Al Willingham <ga...@cox.net> on 2003/04/03 19:47:00 UTC

Removing nested bean collections in session scope.......

Hi,

Thanks for considering this...

I'm really stumped. I have several layers of collections, ie, a nest of
beans inside a nested bean in an actionForm with session scope. When I
am finished with the collections, I call my own reset method and set the
top level collection to null. I am not overriding the default reset.

I assume that if I set the top level collection to null, that there is
no longer a reference to the other nested collections and they are
garbage collected.

When I re-use the actionForm within the same session, the collections
that were nested are still in session scope and reappear. But, the
collection that I set to null is null.

I am sure I am getting the correct session bean because I check for an
attribute with a unique value before and after I call my reset.

I would really appreciate any insight or suggestions.

Thanks
Al

-- 
Al Willingham <ga...@cox.net>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Removing nested bean collections in session scope.......

Posted by Al Willingham <ga...@cox.net>.
If I remove the mapping to my actionForm, I get an error indicating that
my jsp cannot retrieve definition for form bean null. Do I need to
usebean scope = session??

My mappings are:

First Mapping......

 <action path="/Operator/network" parameter="TEST"
type="com.qualcomm.wirelessdevices.controller.OperatornetworkAction"
      scope="session" name="operatornetworkForm" validate="false" >
      <forward name="success" path="manager.Operator.networksummary"/>
      <forward name="cancel" redirect="true" path="/do/Operator/list"/>
    </action>
    
Second Mapping....
    <action path="/Operator/networkdetails" parameter="NETDETAIL"
type="com.qualcomm.wirelessdevices.controller.OperatornetworkAction"
      scope="session" name="operatornetworkForm" validate="false" >
      <forward name="success" path="manager.Operator.networksummary"/>
      <forward name="successfulmanuf" path="/do/Operator/list"/>
      <forward name="cancel" redirect="true" path="/do/Operator/list"/>
    </action>



Changed second mapping to.....

    <action path="/Operator/networkdetails" parameter="NETDETAIL"
type="com.qualcomm.wirelessdevices.controller.OperatornetworkAction">
      <forward name="success" path="manager.Operator.networksummary"/>
      <forward name="successfulmanuf" path="/do/Operator/list"/>
      <forward name="cancel" redirect="true" path="/do/Operator/list"/>
    </action>



On Thu, 2003-04-03 at 10:24, apachep2 wrote:
> I have had this issue before. In your next action, remove mapping to the
> ActionForm in your struts-config.xml.
> 
> -----Original Message-----
> From: Al Willingham [mailto:gaffer@cox.net] 
> Sent: April 3, 2003 12:47 PM
> To: struts-user@jakarta.apache.org
> Cc: arron@keyboardmonkey.com
> Subject: Removing nested bean collections in session scope.......
> 
> Hi,
> 
> Thanks for considering this...
> 
> I'm really stumped. I have several layers of collections, ie, a nest of
> beans inside a nested bean in an actionForm with session scope. When I
> am finished with the collections, I call my own reset method and set the
> top level collection to null. I am not overriding the default reset.
> 
> I assume that if I set the top level collection to null, that there is
> no longer a reference to the other nested collections and they are
> garbage collected.
> 
> When I re-use the actionForm within the same session, the collections
> that were nested are still in session scope and reappear. But, the
> collection that I set to null is null.
> 
> I am sure I am getting the correct session bean because I check for an
> attribute with a unique value before and after I call my reset.
> 
> I would really appreciate any insight or suggestions.
> 
> Thanks
> Al
-- 
Al Willingham <ga...@cox.net>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Removing nested bean collections in session scope.......

Posted by apachep2 <ap...@hotmail.com>.
I have had this issue before. In your next action, remove mapping to the
ActionForm in your struts-config.xml.

-----Original Message-----
From: Al Willingham [mailto:gaffer@cox.net] 
Sent: April 3, 2003 12:47 PM
To: struts-user@jakarta.apache.org
Cc: arron@keyboardmonkey.com
Subject: Removing nested bean collections in session scope.......

Hi,

Thanks for considering this...

I'm really stumped. I have several layers of collections, ie, a nest of
beans inside a nested bean in an actionForm with session scope. When I
am finished with the collections, I call my own reset method and set the
top level collection to null. I am not overriding the default reset.

I assume that if I set the top level collection to null, that there is
no longer a reference to the other nested collections and they are
garbage collected.

When I re-use the actionForm within the same session, the collections
that were nested are still in session scope and reappear. But, the
collection that I set to null is null.

I am sure I am getting the correct session bean because I check for an
attribute with a unique value before and after I call my reset.

I would really appreciate any insight or suggestions.

Thanks
Al

-- 
Al Willingham <ga...@cox.net>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org