Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Antoni Alatalo
Redirecting back to the original page after filter - how to do?
January 23, 2008 9:55 PM
Answer

Antoni Alatalo

Rank: New Member

Posts: 17

Join Date: November 25, 2007

Recent Posts

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 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. Unfortunatelly i don't have Struts sources to debug it's functionality to chack what happends there.

Do anybody knows what goes wrong?

Thank you
Antoni
Antoni Alatalo
RE: Redirecting back to the original page after filter - how to do?
January 24, 2008 2:14 AM
Answer

Antoni Alatalo

Rank: New Member

Posts: 17

Join Date: November 25, 2007

Recent Posts

Hi,
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

Any ideas?
Antoni
Antoni Alatalo
RE: Redirecting back to the original page after filter - how to do?
February 18, 2008 10:47 PM
Answer

Antoni Alatalo

Rank: New Member

Posts: 17

Join Date: November 25, 2007

Recent Posts

Hi,
anyone? anything help?

Antoni