Fórumok

issue getting url parameter

Eric Soucy, módosítva 9 év-val korábban

issue getting url parameter

Junior Member Bejegyzések: 65 Csatlakozás dátuma: 2014.01.21. Legújabb bejegyzések
Hello,
My JSF portlet is being called by an external app (using redirection).
This external application adds extra query parameter with a second question mark "?"
for example it does a redirect to:

https://localhost:8443/web/test/test-portlet?p_p_id=portlettestnetbanx_WAR_portlettestnetbanx&_portlettestnetbanx_WAR_portlettestnetbanx__jsfBridgeViewId=%2Fviews%2Fview3.xhtml?confirmationNumber=266927410&


In my managedbean, I am having a hard time retrieving the confirmationNumber from the url.
Is there a way to do that ?

Thank you
thumbnail
Neil Griffin, módosítva 9 év-val korábban

RE: issue getting url parameter

Liferay Legend Bejegyzések: 2655 Csatlakozás dátuma: 2005.07.27. Legújabb bejegyzések
Hi Eric,

Is it possible to fix the external application so that it appends an ampersand rather than a question-mark?

Kind Regards,

Neil
Eric Soucy, módosítva 9 év-val korábban

RE: issue getting url parameter

Junior Member Bejegyzések: 65 Csatlakozás dátuma: 2014.01.21. Legújabb bejegyzések
Hi Neil, unfortunately that would be very hard.
Is there a way to get the complete url? I could always parse it myself afterwards
to get the confirmationNumber.

Thanks
thumbnail
Neil Griffin, módosítva 9 év-val korábban

RE: issue getting url parameter

Liferay Legend Bejegyzések: 2655 Csatlakozás dátuma: 2005.07.27. Legújabb bejegyzések
You can try this:

ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
ThemeDisplay themeDisplay = (ThemeDisplay) externalContext.requestParameterMap(WebKeys.THEME_DISPLAY);
String portalURL = themeDisplay.getPortalURL();


Or you can just call:
LiferayFacesContext.getInstance().getThemeDisplay().getPortalURL();
Eric Soucy, módosítva 9 év-val korábban

RE: issue getting url parameter

Junior Member Bejegyzések: 65 Csatlakozás dátuma: 2014.01.21. Legújabb bejegyzések
Hi Neil,
I tried your suggestions, I get the URL up to the second "?" (https://localhost:8443/web/test/test-portlet?p_p_id=portlettestnetbanx_WAR_portlettestnetbanx&_portlettestnetbanx_WAR_portlettestnetbanx__jsfBridgeViewId=%2Fviews%2Fview3.xhtml)

but I don't get the last part ?confirmationNumber=1234
Do you have another suggestion ?
Thanks so much for your help.
thumbnail
Neil Griffin, módosítva 9 év-val korábban

RE: issue getting url parameter

Liferay Legend Bejegyzések: 2655 Csatlakozás dátuma: 2005.07.27. Legújabb bejegyzések
You can also try:

liferayFacesContext.getRequestQueryString();