Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
vikendra kumar
servlet request in portlet
November 16, 2011 7:57 PM
Answer

vikendra kumar

Rank: New Member

Posts: 4

Join Date: September 26, 2011

Recent Posts

Hi

thnx in advance .
how can we get the http servlet request in protlet class.
Pankaj Kathiriya
RE: servlet request in portlet
November 16, 2011 9:10 PM
Answer

Pankaj Kathiriya

Rank: Expert

Posts: 395

Join Date: August 4, 2010

Recent Posts

Hi,
You can use following to get Http Servlet request.

HttpServletRequest request = PortalUtil.getHttpServletRequest(actionRequest);

HTH,

Pankaj
vikendra kumar
RE: servlet request in portlet
November 16, 2011 10:13 PM
Answer

vikendra kumar

Rank: New Member

Posts: 4

Join Date: September 26, 2011

Recent Posts

thank you pankaj

i got the http servlet request but i want to one more thing. that if iuse get method in form in view.jsp and make any url (render or action ) then i am not able to get the parameters set to url or any form field value and if i use action url and get method in form then proccess action method is not executed. why.? i want to know th reason .

thanks and regards
Pankaj Kathiriya
RE: servlet request in portlet
November 16, 2011 10:36 PM
Answer

Pankaj Kathiriya

Rank: Expert

Posts: 395

Join Date: August 4, 2010

Recent Posts

Hi Vikendra ,

Support of the get method is optional according to the standard. Since portal consumers are not required to support the get method ,it seems Liferay is not providing support for GET method.

Thanks,
Pankaj
Hitesh Dangi
RE: servlet request in portlet
November 17, 2011 12:09 AM
Answer

Hitesh Dangi

Rank: New Member

Posts: 11

Join Date: December 13, 2010

Recent Posts

private String getParameterValue(final PortletRequest portletRequest,final String paramName)
{

final HttpServletRequest request = PortalUtil.getHttpServletRequest(portletRequest);

String paramValue = ParamUtil.getString(PortalUtil.getOriginalServletRequest(request),
paramName, null);

if (paramValue == null)
{

paramValue = ParamUtil.getString(request, paramName, null);

if (paramValue == null)
{
paramValue = ParamUtil.getString(portletRequest, paramName, null);
}
}

return paramValue;
}