How to obtain the real current url ?
| Diego Figueroa | : | Hi all, |
| I have a portlet and I am trying to get the current url with: | ||
| String currentURL = PortalUtil.getCurrentURL(request); | ||
| My current url is something like: | ||
| http://mysite.com/user/diego/3/.... | ||
| however using the getCurrentURL() method above I get something like: | ||
| /c/portal/layout?p_l_id=3071616 | ||
| instead of: | ||
| /user/diego/3 | ||
| Is there another method that returns this more friendly URL? | ||
| Thanks all! | ||
| Diego. | ||
| Mazhar Anwar | : | I think you can try themeDisplay.getURLCurrent() method. Please check the signature in ThemeDisplay.java of portal source. |
| Regards, | ||
| Sandeep Nair | : | Hi, |
| Try doing this | ||
| themeDisplay.getLayout().getFriendlyURL(); | ||
| Regards, | ||
| Sandeep | ||
| KK rajput | : | Hi , |
| are you using ext environment use this PortletURL url = PortletURLUtil.getCurrent(PortletRequest preq, MimeResponse mimeResponse or RenderResponse renderResponse) | ||
| Thanks | ||
| KamalKant | ||
| Diego Figueroa | : | Thank you all for your input. |
| I found the solution I wanted thanks to your information: | ||
| PortalUtil.getLayoutURL(themeDisplay.getLayout(),themeDisplay); | ||
| This gives me the complete URL that I wanted | ||
try this ..
ReplyDeletePortalUtil.getCurrentURL(PortalUtil.getHttpServletRequest(portletRequest))
Lifery 6.1