You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Antoni <an...@wmdata.fi> on 2008/01/25 09:00:33 UTC

Redirecting back to the original page after filter - how to do?

Hi,

here is the same message as in the thread
http://www.liferay.com/web/guest/community/forums/message_boards/message/413646
Nobody seems answer there so I ask again from this forum.

I use Struts as a part of Liferay. Struts seems to be a version 1.3. Liferay
is version 4.3.5

I have the next case:

One page is "protected" by filter, lets name it "/web/guest/protected".
After entering the url to this protected page user is redirected to the
outside application.
User authenticates in the outside application.
After authentication user is redirected back to the original url
"/web/guest/protected".
Once again filter launches. It sets some attributes to the session (it does
not actually login user to the portal!).
Also the same filter wraps request. Actually it sets original requests
parameters to the wrapped request.
After all is done filters chaine proceeds request.

The problem is that after user is returned from the outside application,
MainServlet for some reason redirects user to the /web/guest/home page
instead of /web/guest/protected page.

Why this happends? I did debug MainServlet. I was watching responses
redirectURL variable. It's null before calling callParentService(req, res)
method. While calling this method redirectURL gets /web/guest/home value. 

I did debug more and found that when i use wrapper around request (extend of
HttpServletRequestWrapper) then
org.apache.catalina.core.ApplicationDispatcher for some reason redirects
response to the first page.
But when request is not wrapped by my filter all works fine.
For now i don't understand why it do it

Do anybody knows what goes wrong?

Thank you
Antoni


-- 
View this message in context: http://www.nabble.com/Redirecting-back-to-the-original-page-after-filter---how-to-do--tp15082833p15082833.html
Sent from the Struts - User mailing list archive at Nabble.com.


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