struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dale Newfield <D...@Newfield.org>
Subject Re: [struts] struts result going to a current page
Date Sun, 17 Feb 2008 06:00:39 GMT
Srinivas Surapaneni wrote:
> To be more specific, Here is we can do in Beehive Pageflow which is based on
> struts 1.x

Since I've never used Beehive, and I don't feel like digging through 
it's internals to figure out how it determines what the "previousPage" 
was, or how it forwards there, I can't tell you exactly what this does.

In general, though, what I'm telling you is that you have two choices. 
You can either have your global result of type httpheader and simply 
return 204 so the request completes but the person is left on whatever 
page they were previously viewing, or you can look in the request to see 
what the "referer" page is, and if set, you can send a redirect to it.

<global-results>
   <result name="noAnswer" type="httpheader">
     <param name="status">204</param>
   </result>
   <result name="redirectToReferrer" type="redirect">
     <param name="location">${#request.getHeader("Referer")}</param>
   </result>
</global-results>


<global-exception-mappings>
   <exception-mapping exception="recoverableExceptionBaseClass" 
result="one-of-the-two-above"/>
</global-exception-mappings>

-Dale

P.S.:  If that request.getHeader bit doesn't work, it's because I think 
the OGNL #request object might be the request namespace rather than the 
actual HttpServletRequest object.  I think that's a standard stumbling 
block, but it's late and I don't recall the standard solution -- can 
someone else please chime in?

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


Mime
View raw message