Dhruv Pandey
Dhruv Pandey

Reputation: 514

Liferay get browser URL

I have a HttpServletRequest object with me in a post login hook. How to get what URL is there is the browser.

When I am using PortalUtil.getCurrentCompleteURL(HttpServletRequest) I am always getting http://localhost:8080/c. I need something like http://localhost:8080/web/abc.

I don't have ThemeDisplay object with me.

Upvotes: 1

Views: 1000

Answers (1)

Tobias Liefke
Tobias Liefke

Reputation: 9022

I guess that the URL you are looking for is the one from before the login. The portal saves that one in the session when redirecting to the login page. You can access it like this:

String lastPath = session.getAttribute(WebKeys.LAST_PATH);

Upvotes: 0

Related Questions