You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Antony Stace <s4...@yahoo.com> on 2002/01/28 05:06:11 UTC
Is there a default action if the requested action dosen't exist?
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?
--
Cheers
Tony
---------------------------------------------------------------------
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Is there a default action if the requested action dosen't exist?
Posted by Ivo Clarysse <so...@coresequence.com>.
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>