Sigh... I tried tackling the first half of this problem today. The first
part is getting the original requested URL as a parameter to the
RedirectActionResult.

       </global-results>
           <result name="login" type="redirect-action">
               <param name="actionName">Login</param>
               <param name="namespace">/</param>
               <param name="origurl">${ServletRequest.requestURI}</param>
<-- not sure about the OGNL here.
           </result>
       </global-results>

All of my actions extend MySupport, which implement ServletRequestAware. I
fired my debugger to see whether the request object would even be set (with
the setServletRequest method) in my action before the redirect-action is
executed. NO! I don't think I can access the ServletRequest object from the
redirect-action configuration!

My only remaining option is to create my own redirect class that taps into
the ServletRequest object via the invocation object. Rigth now S2 is looking
very very unattractive as a web framework, because the OGNL features are not
well documented (esp in relation to struts results), and because the given
Result and Interceptor classes are not suitable for my basic needs such as
resume after redirect.

- Jae

On 4/6/07, Dave Newton <[EMAIL PROTECTED]> wrote:

--- meeboo <[EMAIL PROTECTED]> wrote:
> One last question regarding this. As I beforehand
> don't know where to redirect the user after the
login
> action I will have to implement the
> ServletResponseAware interface and then use the
> HttpServletResponse for this. This seems like an
ugly
> way to redirect the user, are there other ways
maybe?

As someone else mentioned if you are using an
interface to set the original URL (like void
setOriginalUrl(String) & String getOriginalUrl()) then
you can map a redirect in your action's config, more
or less like the following:

<result type="redirect">${originalUrl}</result>

That was a day or two ago; I don't have a reference to
it handy and I don't recall who the poster was.

d.





____________________________________________________________________________________
It's here! Your new message!
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to