Thanks, but it appears I get that crash even if I PageRedirect to another page and use meta refresh.

I couldn't find the cause of the problem so I just used a custom RestartService which gets the redirect destination from a configuration file. Tapestry's close relationship to Hivemind makes things like that extremely simple, it took me less than two minutes to do. :)

Martin

On Thu, 06 Apr 2006 02:46:17 +0200, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:

You could always send them to a  "logging out" page that has en embeeded
meta redirect in the html header.

On 4/5/06, Martin Strand <[EMAIL PROTECTED]> wrote:

Hi all.
I've got a logout link and I want it to redirect the user to another
location (not the home page) after the session's been invalidated. The
listener looks like this:

public void doLogout()
{
        try
        {
                IEngineService restartService = getRestartService();
                restartService.service(getPage().getRequestCycle());
                throw new RedirectException("
http://www.somewhere-else.com/";);
        }
        catch (IOException e)
        {
                log.warn(e.getMessage());
        }
}


But, this code results in an IllegalStateException being thrown later in
the same request. It appears Tapestry tries to update the session after
it's been invalidated.
So, how can I accomplish what i'm trying to do with the above code?



06-Apr-2006 01:47:31
org.apache.tapestry.error.RequestExceptionReporterImpl
reportRequestException
WARNING: Unable to process client request: java.lang.IllegalStateException
java.lang.IllegalStateException
        at
org.apache.catalina.connector.ResponseFacade.sendRedirect(
ResponseFacade.java:432)
        at
org.apache.tapestry.web.ServletWebRequest.sendRedirect(
ServletWebRequest.java:150)
        at
org.apache.tapestry.web.ServletWebRequest.forward(ServletWebRequest.java
:141)
        at $WebRequest_10a6c738f00.forward($WebRequest_10a6c738f00.java)
        at $WebRequest_10a6c738eb9.forward($WebRequest_10a6c738eb9.java)
        at
org.apache.tapestry.engine.AbstractEngine.handleRedirectException(
AbstractEngine.java:522)
        at
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:258)
...
...

Unable to process client request: java.lang.IllegalStateException

06-Apr-2006 01:47:31
org.apache.tapestry.error.RequestExceptionReporterImpl
reportRequestException
WARNING: Exception during post-request cleanup: setAttribute: Session
already invalidated
java.lang.IllegalStateException: setAttribute: Session already invalidated
        at
org.apache.catalina.session.StandardSession.setAttribute(
StandardSession.java:1245)
        at
org.apache.catalina.session.StandardSessionFacade.setAttribute(
StandardSessionFacade.java:129)
        at
org.apache.tapestry.web.ServletWebSession.setAttribute(
ServletWebSession.java:62)
        at
org.apache.tapestry.engine.state.SessionScopeManager.store(
SessionScopeManager.java:90)
        at

$StateObjectPersistenceManager_10a6c738fcb.store($StateObjectPersistenceManager_10a6c738fcb.java)
        at
org.apache.tapestry.engine.state.StateObjectManagerImpl.store(
StateObjectManagerImpl.java:55)
        at
org.apache.tapestry.engine.state.ApplicationStateManagerImpl.flush(
ApplicationStateManagerImpl.java:87)
        at

$ApplicationStateManager_10a6c738e91.flush($ApplicationStateManager_10a6c738e91.java)
        at

$ApplicationStateManager_10a6c738e92.flush($ApplicationStateManager_10a6c738e92.java)
        at
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:290)
...
...

Exception during post-request cleanup: setAttribute: Session already
invalidated

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




--
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.  http://opennotion.com




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

Reply via email to