You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by koen boutsen <ko...@lycos.com> on 2003/10/09 16:40:42 UTC

redirect problem

Hi
If the session is invalid, I want to send the user to the logon page.  This works fine when I go through an action.  In some cases, I don't go through an action, I want to redirect the user. 
I tried it like this : (sessionIsValid is a attribute in the session. If this attribute is null, it means that my session does no longer exist).

<iflogic:if name="sessionIsValid" op="NotPresent">
<iflogic:then>
	<logic:redirect page="/pages/logon/logonLayout.jsp" />
</iflogic:then>
<iflogic:else>
</iflogic:else>
</iflogic:if>

This is the error I get :
ava.lang.IllegalStateException
[9/10/03 15:44:01:242 CEST] 498b26a6 SystemErr     R 	at com.ibm.ws.webcontainer.webapp.WebAppDispatcherResponse.sendRedirect(WebAppDispatcherResponse.java:87)
[9/10/03 15:44:01:242 CEST] 498b26a6 SystemErr     R 	at org.apache.struts.taglib.logic.RedirectTag.doEndTag(RedirectTag.java:306)
[9/10/03 15:44:01:242 CEST] 498b26a6 SystemErr     R 


Any reply will be appreciated, because I'm completely stuck

Thanks

Koen




____________________________________________________________
Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005

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


Re: redirect problem

Posted by Deepak <de...@ltp.soft.net>.
You can create your own tag-lib.

Something like
<app:checkLogon/>

All the logic to check if session is valid or not can go to the class
handling this tag.

regards
deepak

----- Original Message -----
From: "koen boutsen" <ko...@lycos.com>
To: <st...@jakarta.apache.org>
Sent: Thursday, October 09, 2003 8:10 PM
Subject: redirect problem


> Hi
> If the session is invalid, I want to send the user to the logon page.
This works fine when I go through an action.  In some cases, I don't go
through an action, I want to redirect the user.
> I tried it like this : (sessionIsValid is a attribute in the session. If
this attribute is null, it means that my session does no longer exist).
>
> <iflogic:if name="sessionIsValid" op="NotPresent">
> <iflogic:then>
> <logic:redirect page="/pages/logon/logonLayout.jsp" />
> </iflogic:then>
> <iflogic:else>
> </iflogic:else>
> </iflogic:if>
>
> This is the error I get :
> ava.lang.IllegalStateException
> [9/10/03 15:44:01:242 CEST] 498b26a6 SystemErr     R at
com.ibm.ws.webcontainer.webapp.WebAppDispatcherResponse.sendRedirect(WebAppD
ispatcherResponse.java:87)
> [9/10/03 15:44:01:242 CEST] 498b26a6 SystemErr     R at
org.apache.struts.taglib.logic.RedirectTag.doEndTag(RedirectTag.java:306)
> [9/10/03 15:44:01:242 CEST] 498b26a6 SystemErr     R
>
>
> Any reply will be appreciated, because I'm completely stuck
>
> Thanks
>
> Koen
>
>
>
>
> ____________________________________________________________
> Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
> http://login.mail.lycos.com/r/referral?aid=27005
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org







Re: redirect problem

Posted by "Prashanth.S" <su...@yahoo.com>.
Hi koen,
I dont know much about how it is handled in struts...but in jsp u can use respone.sendRedirect("/foo/bar.jsp")
Thanks
Prashanth


koen boutsen <ko...@lycos.com> wrote:
Hi
If the session is invalid, I want to send the user to the logon page. This works fine when I go through an action. In some cases, I don't go through an action, I want to redirect the user. 
I tried it like this : (sessionIsValid is a attribute in the session. If this attribute is null, it means that my session does no longer exist).









This is the error I get :
ava.lang.IllegalStateException
[9/10/03 15:44:01:242 CEST] 498b26a6 SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppDispatcherResponse.sendRedirect(WebAppDispatcherResponse.java:87)
[9/10/03 15:44:01:242 CEST] 498b26a6 SystemErr R at org.apache.struts.taglib.logic.RedirectTag.doEndTag(RedirectTag.java:306)
[9/10/03 15:44:01:242 CEST] 498b26a6 SystemErr R 


Any reply will be appreciated, because I'm completely stuck

Thanks

Koen




____________________________________________________________
Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005

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


---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search