You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Franck Lefebure <fl...@orangecaraibe.com> on 2003/09/25 16:47:28 UTC

action chaining and request.getRequestURI()

Hi,
My struts-config looks like :

<struts-config>

  <global-forwards>
    <forward name="error" path="/doError.do" />
  </global-forwards>
  <action-mappings>
     <action path = "/doError" scope="request"
type="com.orange.struts.actions.ErrorAction">
        <forward name="success" path="/error.jsp" contextRelative="true"/>
    </action>
    <action path = "/doNews" scope="request"
type="com.orange.struts.actions.news.NewsAction" >
        <forward name="onenews" path="/onenews.jsp" redirect="false"/>
        <forward name="manynews" path="/manynews.jsp" redirect="false"/>
    </action>
  </action-mappings>


When I catch an Exception in NewsAction, I "mapping.findForward("error");"
In the doError.do, I want to record data about the Exception in a table.

The Url I used to launch this process is http://myserver/doNews.do
I want to store this url in the table but if I do something like
request.getRequestUrl() in the ErrorAction
then the result is  " doError.do ". I would like the real Url ( " doNews.do
")

Is there any solution to that ?

Thanks

--
Franck Lefebure
equipe web http://www.orangecaraibe.com
mailto:flefebure2@orangecaraibe.com




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: action chaining and request.getRequestURI()

Posted by Manish Singla <Ma...@Sun.COM>.
You go from one action to another action by requestdispatcher ..thus 
request.getRequestURI() will not serve your purpose


One solution is you can read request header "Referer" in "/doerror.do"
Now, above header is optional.

Or else , you may set request.setAttribute in "/doNews.do"  which you 
can read in "/doerror.do"





Franck Lefebure wrote:
> Hi,
> My struts-config looks like :
> 
> <struts-config>
> 
>   <global-forwards>
>     <forward name="error" path="/doError.do" />
>   </global-forwards>
>   <action-mappings>
>      <action path = "/doError" scope="request"
> type="com.orange.struts.actions.ErrorAction">
>         <forward name="success" path="/error.jsp" contextRelative="true"/>
>     </action>
>     <action path = "/doNews" scope="request"
> type="com.orange.struts.actions.news.NewsAction" >
>         <forward name="onenews" path="/onenews.jsp" redirect="false"/>
>         <forward name="manynews" path="/manynews.jsp" redirect="false"/>
>     </action>
>   </action-mappings>
> 
> 
> When I catch an Exception in NewsAction, I "mapping.findForward("error");"
> In the doError.do, I want to record data about the Exception in a table.
> 
> The Url I used to launch this process is http://myserver/doNews.do
> I want to store this url in the table but if I do something like
> request.getRequestUrl() in the ErrorAction
> then the result is  " doError.do ". I would like the real Url ( " doNews.do
> ")
> 
> Is there any solution to that ?
> 
> Thanks
> 
> --
> Franck Lefebure
> equipe web http://www.orangecaraibe.com
> mailto:flefebure2@orangecaraibe.com
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


-- 
Thanks
Manish Singla
x73166


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org