Either by configuring the module or action for the exception in the
struts-config.xml
To configure it for the module...
<global-exceptions>
<exception
type="org.apache.struts.chain.commands.UnauthorizedActionException"
path="/myUnauthorizedAction" />
</global-exceptions>
...or for a specific Action...
<action path="/fooAction" type"...">
<exception
type="org.apache.struts.chain.commands.UnauthorizedActionException"
path="/myUnauthorizedAction" />
</global-exceptions>
Niall
On 9/28/06, Martin Gainty <[EMAIL PROTECTED]> wrote:
How does one redirect or forward to *alternate action* using
UnauthorizedActionException
Thanks for the info,
Martin--
----- Original Message -----
From: "Niall Pemberton" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[email protected]>
Sent: Wednesday, September 27, 2006 9:01 PM
Subject: Re: multiple module 403 forward
> On 9/27/06, Derrick Koes <[EMAIL PROTECTED]> wrote:
>> How can I configure my web app so that each module will forward a 403
>> error to a different page?
>
> In the Struts 1.2.x series there is nothing to do what you want - the
> request processor just uses HttpServletResponse.sendError(403, "User
> is not authorized to access action x") - so you can only configure the
> webapp as a whole through the web.xml. For 404's you can configure an
> "unknown" action for each module - but theres nothing equivalent for
> authorization errors. To do this you would need to create your own
> custom RequestProcessor implementation and override the processRoles()
> method.
>
> In the Struts 1.3.x series the equivalent Command is the
> "AuthorizeAction" which works differently to Struts 1.2.x - instead of
> using HttpServletResponse's sendError() method it throws an
> "UnauthorizedActionException" - so you can configure an exception
> handler on a per-module basis to show different pages.
>
> Niall
>
>> Thanks,
>> Derrick
>
> ---------------------------------------------------------------------
> 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]