Antony Stace wrote:

>Hi
>
>Can I make a default action.  If the user types in a wrong/incorrect/bogus file path 
>after a valid struts
>application, ie
>
>http://localhost:8180:/testapp.do/logo.do              
>http://localhost:8180:/testapp.do/asdufho           
>
>then I want the request to be mapped to
>
>http://localhost:8180:/testapp/logon.do
>
>How can I do this?
>
In your web.xml file, insert somethink like:

<error-page>
  <error-code>404</error-code>
  <location>/logon.do</location>
</error-page>

(Note that the order of elements in web.xml is important; error-page 
tags should come right after any 'welcom-file-list' tag)

Also note that forwarding to the login page will not work if you are 
using container-manager security (as then you are not allowed to forward 
to the login page directly), however forwarding to something like 
'/notFound.do' will work.

Ivo.


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

Reply via email to