Foren

Getting paramters from currentURL.

Rahul Saraswat, geändert vor 10 Jahren.

Getting paramters from currentURL.

New Member Beiträge: 18 Beitrittsdatum: 09.01.13 Neueste Beiträge
Hi,

Does anyone have an idea of getting parameters from the CurrentUrl. I am using PortalUtil to get currentUrl but need to get parameters in that url. Below is the code snippet.

PortalUtil.getCurrentUrl(request);

the url is as below :

http://localhost:8080/app_name/parameter-name

So I need to get the "parameter-name" from the above url.


Thanks & Regards
Rahul Saraswat
akaram siddiqui, geändert vor 10 Jahren.

RE: Getting paramters from currentURL.

Junior Member Beiträge: 56 Beitrittsdatum: 16.05.13 Neueste Beiträge
PortletURL portletURL=themeDisplay.getURLCurrent();
This will give you portletURL=http://localhost:8080/app_name/parameter-name


String[] afterSplit = portletURL.toString().split("parameter-name");
String newString = afterSplit[0];
System.out.println("newString"+newString);