Ok, got it working, i was using the convention plugin. but i had to
manually define the action which take care of the error in struts.xml
Thanks,
Nuwan
Nuwan Chandrasoma wrote:
Hi All,
does this work with jetty?. I couldn't get this working with jetty
sometime back :)
Thanks,
Nuwan
ManiKanta G wrote:
to which filter mapping? FilterDispatcher's mapping?
And could give sample snippet of web.xml using .action for http 404
error?
Well I got it... yes, for FilterDispatcher's mapping only the dispatcher
config should be there.
Reason:
.... If no types are specified, the default option is REQUEST.
(from http://docs.sun.com/app/docs/doc/819-3669/6n5sg7b0b). Thanks Dave.
So by default filters will intercept only for REQUEST type. If we
want to
use action result as the error page, then the FilterDispacther need to
intercept that request which is of error type.
That's why we need to explicitly tell that.
With '404' configured some where in the struts action config, below
snippet
is useful for using action result as error page:
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
<error-page>
<error-code>404</error-code>
<location>/404.action</location>
</error-page>
ManiKanta
---------------------------------------------------------------------
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]