Sunday, June 30, 2013

How to read URL paramerters in Liferay

Ex:- Then below example 1 is used to fetch the details in jsp page there we have already HttpRequest  availabel suppose we are fetching the same thing in Java Class then check for example 2

1.

URL : http://localhost:8080/web/guest/testing?name=INTHIYAZ

To read the parameter name from the URL of your jsp page when it is redirecting from the "Servlet" then u can read it as follows

String urlparam = PortalUtil.getOriginalServletRequest(request).getParameter("name");

Note : Here the "request" is HttpRequest

 2.
 URL : http://localhost:8080/web/guest/testing?name=INTHIYAZ

HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(renderRequest);

String urlparam = httpRequest.getParameter("name");

Liferay DXP JNDI Data Source Cofiguration

 This Blog will help us to learn about the JNDI Data Source Configuration in Liferay DXP. We have tested this with Liferay 7.3 with Tomcat. ...