• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts and Tiles issue: how to get the request URL ?

 
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,
I have a Spring + Struts web application and I am using the Spring Acegi for user authentication. I have a login link in a jsp which is embedded into in a base tile and this link appears on all pages in the webapp.

My original problem was to redirect the user to the same page where he was in, after successful login. With Acegi, i had to override the successfulAuthentication method in the AuthenticationProcessingFilter to retrieve the requestUrl from the session attribute and redirect to this url after successful login.

I tried setting the original request url in my user login jsp and also in the Struts Action for the userlogin. But the problem is, i am not able to get the original request url (the one which is displayed in the address bar of the browser) with the request.getRequestURL method because this method returns the url of the base tile.

I already did a lot of searching for this topic, found some solutions discussed, but they require changing all the actions that could be invoked from the webapp, to store the request url into the session attribute

This looks like a common issue for webapps which want to redirect the user to the page he was in previously before logging in. Is there a easy solution to this problem?

Regards,
Reghu
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
----------
I tried setting the original request url in my user login jsp and also in the Struts Action for the userlogin. But the problem is, i am not able to get the original request url (the one which is displayed in the address bar of the browser) with the request.getRequestURL method because this method returns the url of the base tile.
------------

Did you try using the following code instead of request.getRequestURL


This path gives original url in browser instead of the url of the base tile.
-----
I already did a lot of searching for this topic, found some solutions discussed, but they require changing all the actions that could be invoked from the webapp, to store the request url into the session attribute
---------

Yes. This requires changing all the action classes. you need to get this path in each action class and set this in either request or session...but I faced problem with setting in session and browser back button..

Thanks,
Nag.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic