You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Miller, Jason" <jm...@ostglobal.com> on 2002/09/24 04:31:36 UTC

RE: RE: The right place/time to clean up a session before session tim e out, or user logoff

What do you have stored in the session that has to be checked on?

I only need the reference to my UserProxy object, so I call the logoff
method like so:

Security.doUserLogoff( this );

if you need other things that are in the session, is it feasible to keep
them elsewhere and key
them by whatever object you are implementing the listener with?  Or can you
make them all listen?
that seems unwieldy, though.

___________________________________________
I have tried something similar with yours: a object stored in the session
and with a HttpSessionBindingListener 
implementation. When the invalidate method is called in the logoff action,
it is too late for the valueUnbound method to 
retrieve anything from the session since it is invalid already.

9/23/2002 2:56:58 PM, "Miller, Jason" <jm...@ostglobal.com> wrote:





--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

RE: [ActionForm] Extending existing ActionForm classes

Posted by Robert Taylor <rt...@mulework.com>.
Charles, I'm not sure why your inheritence chain wouldn't work if your
CreateUserProfileForm extends ActionForm and UpdateUserProfileForm extends
CreateUserProfileForm. You may want to take 5 minutes and create a test
scenario; create AForm which extends from ActionForm and create BForm and
which extends AForm. Don't add any getters or setters or additional code.
Defined them in your struts-config.xml file and then see what happens.


What about using the same form for both updating and creating user profiles.
Your create page will just not use all the form fields. Now if you are not
using StrutsValidator and you have hard coded validation for each form, then
it may be cleaner to stick with the two separate forms.

When you get a few extra cycles, you may want to look into using
StrutsValidator, DynaValidatorActionForm, and DynaBeans. It is well worth
the time invested.

robert
> -----Original Message-----
> From: Charles [mailto:charles@radworkz.com]
> Sent: Tuesday, September 24, 2002 6:59 PM
> To: Struts Users Mailing List
> Subject: Re: [ActionForm] Extending existing ActionForm classes
>
>
> Yup my CreateUserProfileForm does extend from ActionForm, but I still get
> the exception. Have you tried something like this before? It would help me
> alot to know that this is something possible and can be done :)
>
>
>
> ----- Original Message -----
> From: "Jin Bal" <ji...@hotmail.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Tuesday, September 24, 2002 12:16 AM
> Subject: Re: [ActionForm] Extending existing ActionForm classes
>
>
> > CreateUserProfileForm etc must extend from ActionForm then
> > UpdateUserProfileForm can extend from CreateUserProfileForm.
> >
> > Your forms must have a base type of ActionForm
> >
> > HTH
> >
> > Jin
> >
> > ----- Original Message -----
> > From: "Charles" <ch...@radworkz.com>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Tuesday, September 24, 2002 7:16 PM
> > Subject: [ActionForm] Extending existing ActionForm classes
> >
> >
> > > Hi,
> > > I got question about new actionform classes extending existing
> actionform
> > > classes. For example, I have this CreateUserProfileForm that
> has all the
> > > fields for User Profiles, which I would like to use them in
> my new form
> > > UpdateUserProfileForm. Is it possible that the UpdateUserProfileForm
> > extend
> > > from the existing CreateUserProfileForm (so that I can reuse all the
> > > existing attributes of that class)  instead of extending from
> ActionForm?
> > > I've tried that and when I start up my application I get a
> > > UnavailableException thrown by the ActionServlet. but when I
> replace the
> > > "extend CreateUserProfileForm" back to "extend ActionForm" everything
> > worked
> > > fine. Could someone help me out ? Thanks.
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> >
> >
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [ActionForm] Extending existing ActionForm classes

Posted by Charles <ch...@radworkz.com>.
Yup my CreateUserProfileForm does extend from ActionForm, but I still get
the exception. Have you tried something like this before? It would help me
alot to know that this is something possible and can be done :)



----- Original Message -----
From: "Jin Bal" <ji...@hotmail.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, September 24, 2002 12:16 AM
Subject: Re: [ActionForm] Extending existing ActionForm classes


> CreateUserProfileForm etc must extend from ActionForm then
> UpdateUserProfileForm can extend from CreateUserProfileForm.
>
> Your forms must have a base type of ActionForm
>
> HTH
>
> Jin
>
> ----- Original Message -----
> From: "Charles" <ch...@radworkz.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Tuesday, September 24, 2002 7:16 PM
> Subject: [ActionForm] Extending existing ActionForm classes
>
>
> > Hi,
> > I got question about new actionform classes extending existing
actionform
> > classes. For example, I have this CreateUserProfileForm that has all the
> > fields for User Profiles, which I would like to use them in my new form
> > UpdateUserProfileForm. Is it possible that the UpdateUserProfileForm
> extend
> > from the existing CreateUserProfileForm (so that I can reuse all the
> > existing attributes of that class)  instead of extending from
ActionForm?
> > I've tried that and when I start up my application I get a
> > UnavailableException thrown by the ActionServlet. but when I replace the
> > "extend CreateUserProfileForm" back to "extend ActionForm" everything
> worked
> > fine. Could someone help me out ? Thanks.
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [ActionForm] Extending existing ActionForm classes

Posted by Jin Bal <ji...@hotmail.com>.
CreateUserProfileForm etc must extend from ActionForm then
UpdateUserProfileForm can extend from CreateUserProfileForm.

Your forms must have a base type of ActionForm

HTH

Jin

----- Original Message -----
From: "Charles" <ch...@radworkz.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, September 24, 2002 7:16 PM
Subject: [ActionForm] Extending existing ActionForm classes


> Hi,
> I got question about new actionform classes extending existing actionform
> classes. For example, I have this CreateUserProfileForm that has all the
> fields for User Profiles, which I would like to use them in my new form
> UpdateUserProfileForm. Is it possible that the UpdateUserProfileForm
extend
> from the existing CreateUserProfileForm (so that I can reuse all the
> existing attributes of that class)  instead of extending from ActionForm?
> I've tried that and when I start up my application I get a
> UnavailableException thrown by the ActionServlet. but when I replace the
> "extend CreateUserProfileForm" back to "extend ActionForm" everything
worked
> fine. Could someone help me out ? Thanks.
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


[ActionForm] Extending existing ActionForm classes

Posted by Charles <ch...@radworkz.com>.
Hi,
I got question about new actionform classes extending existing actionform
classes. For example, I have this CreateUserProfileForm that has all the
fields for User Profiles, which I would like to use them in my new form
UpdateUserProfileForm. Is it possible that the UpdateUserProfileForm extend
from the existing CreateUserProfileForm (so that I can reuse all the
existing attributes of that class)  instead of extending from ActionForm?
I've tried that and when I start up my application I get a
UnavailableException thrown by the ActionServlet. but when I replace the
"extend CreateUserProfileForm" back to "extend ActionForm" everything worked
fine. Could someone help me out ? Thanks.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: RE: RE: The right place/time to clean up a session before session tim e out, or user logoff

Posted by Tony Baity <to...@yahoo.com>.
Vernon,
Yes, there are some possible timing issues with using object references attached to the session in any class implementing HttpSessionBindingListener. I believe that the order which references are unbound is unpredictable. 
When I did this, I ran into the same problem and compromised by using a constructor that would copy any reference that I might need for the session, inside the class implementing HttpSessionBindingListener.

But... from a bird's eye view of this issue, I see that MVC, as used with servlet programming, appears to not be a complete solution for creating "action"s that are generated from clock events that need to interact with stateful data used by "action"s from user events. 

I would like to see a way to reuse a Struts action by a listener, etc. and set it up all within the struts_config. 

I do not want to turn Struts into daemon or anything like that. But it would be nice if it's footprint of responsibility might cover some of these other events that are not strictly MVC-user requests.

-Tony

 Vernon Wu wrote:
Jason,

Now, I see what you're doing here. Rather than calling the session invalidate method in the log off, you call the method 
to clean up the session. That is some thought. I, however, think there shall be a more straight forward solution than 
twise thing around by the servlet desing.

Thanks for explaining your solution.

Vernon

9/23/2002 7:31:36 PM, "Miller, Jason" wrote:





--
To unsubscribe, e-mail: 
For additional commands, e-mail: 



---------------------------------
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!

Re: RE: RE: The right place/time to clean up a session before session tim e out, or user logoff

Posted by Vernon Wu <ve...@gatewaytech.com>.
Jason,

Now, I see what you're doing here. Rather than calling the session invalidate method in the log off, you call the method 
to clean up the session. That is some thought. I, however, think there shall be a more straight forward solution than 
twise thing around by the servlet desing.

Thanks for explaining your solution.

Vernon
 
9/23/2002 7:31:36 PM, "Miller, Jason" <jm...@ostglobal.com> wrote:





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: RE: RE: The right place/time to clean up a session before session tim e out, or user logoff

Posted by Vernon Wu <ve...@gatewaytech.com>.
Jason,

Your solution covers the log off case. How about session time out, say, a user leave a page of the application and 
browse another site. There isn't log off action in this case. 

 
9/23/2002 7:31:36 PM, "Miller, Jason" <jm...@ostglobal.com> wrote:





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>