You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "Sun, Benjamin" <BS...@knightridder.com> on 2003/10/08 19:38:12 UTC

Store ActionForm in session with different keys

Does any have this need to store ActionForm in session with different keys?

The normal way to set the attribute is to do the following in the Action,

	session.setAttribute(mapping.getAttribute(), regform);



What we need is

for http://www.domainA.com
session.setAttribute(get_domainA_attribute, regform);

for http://www.domainB.com
session.setAttribute(get_domainB_attribute, regform);

so, different form info can be put in the session at the same time.

I have tried to call mapping.setAttribute() in RequestProcessor, but got a
configuration locked error.

I am going to try extend ActionMapping and override the
mapping.getAttribute/setAttribute method.  Is this the
right way to go?

Could anyone help?  I do think this should be a struts feature if it is not
there yet.  BTW, we have our
whole registration built on top of struts and it runs very well.

Thanks,

Ben

                           

============================================================================
====
Benjamin Sun                       ;) Be passionate:
                                        No muscle is stronger than a human
heart
Knight Ridder Digital
Home of RealCities.com
http://www.realcities.com

Email: bsun@knightridder.com
Phone: (O) 1.408.938.6120
       (C) 1.650.279.0014
Yahoo: sunb0930
AOL  : bensun888

  

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


Re: Store ActionForm in session with different keys

Posted by James Mitchell <jm...@apache.org>.
Please do not cross post to both -user and -dev.  We are on both lists.


--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017
770.822.3359
AIM:jmitchtx



----- Original Message ----- 
From: "Sun, Benjamin" <BS...@knightridder.com>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Cc: "Struts Developers List" <st...@jakarta.apache.org>
Sent: Wednesday, October 08, 2003 1:38 PM
Subject: Store ActionForm in session with different keys


> Does any have this need to store ActionForm in session with different
keys?
>
> The normal way to set the attribute is to do the following in the Action,
>
> session.setAttribute(mapping.getAttribute(), regform);
>
>
>
> What we need is
>
> for http://www.domainA.com
> session.setAttribute(get_domainA_attribute, regform);
>
> for http://www.domainB.com
> session.setAttribute(get_domainB_attribute, regform);
>
> so, different form info can be put in the session at the same time.
>
> I have tried to call mapping.setAttribute() in RequestProcessor, but got a
> configuration locked error.
>
> I am going to try extend ActionMapping and override the
> mapping.getAttribute/setAttribute method.  Is this the
> right way to go?
>
> Could anyone help?  I do think this should be a struts feature if it is
not
> there yet.  BTW, we have our
> whole registration built on top of struts and it runs very well.
>
> Thanks,
>
> Ben
>
>
>
>
============================================================================
> ====
> Benjamin Sun                       ;) Be passionate:
>                                         No muscle is stronger than a human
> heart
> Knight Ridder Digital
> Home of RealCities.com
> http://www.realcities.com
>
> Email: bsun@knightridder.com
> Phone: (O) 1.408.938.6120
>        (C) 1.650.279.0014
> Yahoo: sunb0930
> AOL  : bensun888
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org


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