You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nguyen Xuan Son <nr...@ed.ritsumei.ac.jp> on 2009/11/26 15:49:56 UTC

redirect command

dear all
im trying to deny any users whose session is not exist, access to my webpage
thus im using the source code
Map ses = ActionContext.getContext().getSession();
if((ses.get("context").toString()=="")&&(ses.get("role").toString()!="admin")){
 //redirect to login page
}
However, i dont know which command should i use to redirect to the login
page
Please help me
Thank you very much


-- 
=======================================================================
Ritsumeikan University, Asia JinZai Project
Master of Information Science
Nguyen Xuan Son

Add       : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18 ShiteiHaimu
Rien, Room 103
Tel/Fax  : 81-(0)90-3976 2246
Email    : nr0003xx@ed.ritsumei.ac.jp
Mobile   : 81-(0)90-3976 2246          URL  : http://www.ritsumei.jp
=======================================================================

Re: redirect command

Posted by Saeed Iqbal <sa...@gmail.com>.
In Java Action Bean you would just have to return a specific string that
struts.xml uses.

On Thu, Nov 26, 2009 at 7:53 PM, Saeed Iqbal <sa...@gmail.com> wrote:

> Instead of programmatically doing it, you can just specify redirect in your
> struts.xml file to the place you want.
>
> On Thu, Nov 26, 2009 at 7:49 PM, Nguyen Xuan Son <
> nr0003xx@ed.ritsumei.ac.jp> wrote:
>
>> dear all
>> im trying to deny any users whose session is not exist, access to my
>> webpage
>> thus im using the source code
>> Map ses = ActionContext.getContext().getSession();
>>
>> if((ses.get("context").toString()=="")&&(ses.get("role").toString()!="admin")){
>>  //redirect to login page
>> }
>> However, i dont know which command should i use to redirect to the login
>> page
>> Please help me
>> Thank you very much
>>
>>
>> --
>> =======================================================================
>> Ritsumeikan University, Asia JinZai Project
>> Master of Information Science
>> Nguyen Xuan Son
>>
>> Add       : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18
>> ShiteiHaimu
>> Rien, Room 103
>> Tel/Fax  : 81-(0)90-3976 2246
>> Email    : nr0003xx@ed.ritsumei.ac.jp
>> Mobile   : 81-(0)90-3976 2246          URL  : http://www.ritsumei.jp
>> =======================================================================
>>
>
>
>
> --
> Saeed Iqbal
> http://www.iqbalconsulting.com
> Struts - J2EE - Application Architect / Developer
>
>


-- 
Saeed Iqbal
http://www.iqbalconsulting.com
Struts - J2EE - Application Architect / Developer

Re: redirect command

Posted by Saeed Iqbal <sa...@gmail.com>.
Instead of programmatically doing it, you can just specify redirect in your
struts.xml file to the place you want.

On Thu, Nov 26, 2009 at 7:49 PM, Nguyen Xuan Son <nr0003xx@ed.ritsumei.ac.jp
> wrote:

> dear all
> im trying to deny any users whose session is not exist, access to my
> webpage
> thus im using the source code
> Map ses = ActionContext.getContext().getSession();
>
> if((ses.get("context").toString()=="")&&(ses.get("role").toString()!="admin")){
>  //redirect to login page
> }
> However, i dont know which command should i use to redirect to the login
> page
> Please help me
> Thank you very much
>
>
> --
> =======================================================================
> Ritsumeikan University, Asia JinZai Project
> Master of Information Science
> Nguyen Xuan Son
>
> Add       : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18
> ShiteiHaimu
> Rien, Room 103
> Tel/Fax  : 81-(0)90-3976 2246
> Email    : nr0003xx@ed.ritsumei.ac.jp
> Mobile   : 81-(0)90-3976 2246          URL  : http://www.ritsumei.jp
> =======================================================================
>



-- 
Saeed Iqbal
http://www.iqbalconsulting.com
Struts - J2EE - Application Architect / Developer