The key is to not put anything in your session. Actions are the
obvious place to look for things being stuffed into the session (via
request.getSession().get/setAttribute()), but you might have a filter
that creates a session as part of what it does, or an action that has
a session-scoped form in struts-config.xml.

If you want to only test for the existance of a session in your
action, don't forget to call request.getSession(false) and then check
the return for null. See the javadoc:

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletRequest.html#getSession(boolean)

Also, if you have other webapps on the web server, they might be using
sessions in their webapps, so anything you do in yours will be for
naught.

-ed

On 12/6/05, Baker, Russ A <[EMAIL PROTECTED]> wrote:
> It is Weblogic. I am using a "graceful" shutdown so that if people still
> have open sessions, they can complete what they are doing. The other
> alternative is to force shutdown, but I am afraid I will make enemies if
> I do that...
>
> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper
> Sent: Tuesday, December 06, 2005 3:53 PM
> To: user@struts.apache.org
> Subject: Re: Session problem
>
> Baker, Russ A wrote:
> > Hello,
> >
> > I am trying to figure out how to stop Struts from creating a session.
> > What seems to happen is that once I call an action, a session is
> > created. This is a problem because when I want to gracefully shut down
> > my server, it complains that I still have an active session. Is there
> a
> > way to configure Struts so that it does not create a session when an
> > action is called?
>
> A session is created the first time something accesses it. Since Struts
> stores various things in session scope, I don't think you can avoid
> having one created.
>
> What container are you using? It seems like an odd behaviour to refuse
> to shut down if there are any active sessions... Are you sure it's
> referring to an HTTP session (as opposed, for example, to a Hibernate
> session or something)?
>
> L.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to