You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marcio Ghiraldelli <ma...@neobiz.com.br> on 2006/03/20 21:36:02 UTC

Struts 1.2 Roles

    Hello,

    the atribute "roles" in an actionMapping configuration works perfectly, deniyng access to unauthorized users. Is there an way to redirect to a login page, instead showing a forbidden error page, like I can do in the web.xml, where a login and an error page can be configured?



Re: Struts 1.2 Roles

Posted by Paul Benedict <pa...@yahoo.com>.
You have two options:

1) Do not use roles. It is coded with mere functionality to return
a 403 if the role is not there. Instead check the role explicity in the
action and do what you want.

2) Use web.xml to handle the error codes. You can configure your
application to take action on certain error codes:

  <error-page>
     <error-code>403</error-code>
     <location>/login.html</location>
  </error-page>

Paul

--- Marcio Ghiraldelli <ma...@neobiz.com.br> wrote:

>     Hello,
> 
>     the atribute "roles" in an actionMapping configuration works perfectly, deniyng access to
> unauthorized users. Is there an way to redirect to a login page, instead showing a forbidden
> error page, like I can do in the web.xml, where a login and an error page can be configured?
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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