掲示板

How to get currentURL

17年前 に Ed F. によって更新されました。

How to get currentURL

Expert 投稿: 280 参加年月日: 06/06/27 最新の投稿
I have copied a lot of Liferay source code, but I can't quite find the mechanism for using the variable 'currentURL'. Sometimes it's declared and accessible for redirects, sometimes it's not. I don't ever actually see a declaration or assignment to this variable, but I've seen it used many times. I must be missing it, I am fairly blind.

Right now I'm wishing to use it but can't seem to find out what to import or how to assign the current url to it.

Does anyone happen to know?

Thanks!
-Ed
thumbnail
17年前 に Joseph Shum によって更新されました。

RE: How to get currentURL

Expert 投稿: 336 参加年月日: 06/05/17 最新の投稿
hey ed, its declared in init.jsp which is included in the jsps that use it.


String currentURL = PortletURLUtil.getCurrent(renderRequest, renderResponse).toString();



joe
17年前 に Ed F. によって更新されました。

RE: How to get currentURL

Expert 投稿: 280 参加年月日: 06/06/27 最新の投稿
Ahh thanks Joe
thumbnail
9年前 に Enrique Valdes Lacasa によって更新されました。

RE: How to get currentURL

Junior Member 投稿: 92 参加年月日: 14/07/29 最新の投稿
If you need to retrieve it in your JSP, you can easily use the themeDisplay object:

String currentURL = themeDisplay.getURLCurrent();