struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Musachy Barroso (JIRA)" <>
Subject [jira] Commented: (WW-3192) When struts is used to render an error-page, getting the action mapping from original request
Date Tue, 11 Aug 2009 19:11:59 GMT


Musachy Barroso commented on WW-3192:

I was unable to reproduce this, this is what I tried, I modified the blank application so
I have this 2 actions:

        <action name="HelloWorld" class="example.HelloWorld">
            <result type="httpheader">
                <param name="error">404</param>

        <action name="Login_*" method="{1}" class="example.Login">
            <result name="input">/example/Login.jsp</result>
            <result type="redirectAction">Menu</result>

in web.xml, I have:





When I go to: http://localhost:8080/struts2-blank/example/HelloWorld.action , I see the Login
page. Do you have "  <dispatcher>ERROR</dispatcher>" in the mapping for the filter?
Otherwise Struts will not see the request to your error page made by the container.

> When struts is used to render an error-page, getting the action mapping from original
> ---------------------------------------------------------------------------------------------
>                 Key: WW-3192
>                 URL:
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Dispatch Filter
>    Affects Versions: 2.1.6
>         Environment: Tomcat 
>            Reporter: Jasper Rosenberg
>            Priority: Critical
>             Fix For: 2.1.8
> We have mapped 404 in the web.xml to a struts action, e.g.:
>   <error-page>
>     <error-code>404</error-code>
>     <location>/404.action</location>
>   </error-page> 
> Sometimes we have an action return a result type to generate a 404 error. This used to
work.  However, now it is failing because PrepareOperations.findActionMapping() is finding
the original mapping still in the request when the servlet container invokes the 404.action
(and so not getting the struts mapping for the 404 action).   I assume this is also a bug
for actions that return a 500 error where the 500 error page is rendered in struts though
I haven't tested it yet.
> One fix would be to call request.removeAttribute(STRUTS_ACTION_MAPPING_KEY) at the end
of  PrepareOperations.cleanupRequest() though perhaps there are implications to that I'm unaware

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message