This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Spring and the fly likes How to get previous URL to current URL in spring MVC portlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "How to get previous URL to current URL in spring MVC portlet" Watch "How to get previous URL to current URL in spring MVC portlet" New topic
Author

How to get previous URL to current URL in spring MVC portlet

rajiv jackz
Greenhorn

Joined: Jul 12, 2010
Posts: 29
HI All,

i need to get value matched from previous URL to Current URL accessed

String url=""+PortalUtil..getCurrentURL(request) takes only current URL .

What can i do for previous URL to current URL accessed

How to do it.

Please Help me out Here!

Thanks in Advance
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Not this is Spring related. But what if you wrote JavaScript that when you submit that page, it gets that current URL that the browser is showing and populate a hidden form field with that value, then you can get it in your code, like any other parameter.

This will only work on your own pages, but if the user comes from anywhere outside your site, from say www.google.com you won't be able to get a "previous" url, because you could be coming from anywhere, and to me even if you could that would be a security risk. I don't want you to know that I was coming from www.somepornsite.com

Hope that makes sense.

Thanks

Mark Spritzler


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get previous URL to current URL in spring MVC portlet