aspose file tools*
The moose likes Portals and Portlets and the fly likes liferay portlet - form parameters missing from request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "liferay portlet - form parameters missing from request" Watch "liferay portlet - form parameters missing from request" New topic
Author

liferay portlet - form parameters missing from request

Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 820

here is a form I have in a liferay portlet. Shown are the different ways I've tried to pass parameters that need to be handled by the portlet.


none of the variables show up in the portlet that handles this form. According the portlet specification, the form should trigger the portlet's processAction() method, but it does not. this form goes to the doView() method without its parameters.

I looked at the source generated for my form's action and it has a url that would otherwise work as intended in my portlet.

Based on this thread from the liferay forums, I seem to have everything set properly. What am I missing?
Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 820

method must be post, apparently.

The following form did call processAction and delivered its form parameters.



note also that processAction can call actionRequest.setRenderParam(String,String) to send parameters back to the doView method
V N K Srujan Kollisetty
Greenhorn

Joined: Jul 19, 2010
Posts: 2


It is best practice to use <portlet:namespace/> tag before the form name. This tag generates unique namespace for every portlet, so that naming conflicts won't occur even multiple portlets in a page have same form name.

Below code will be sollution to your problem. <portlet:actionURL > will invoke processAction() method of same portlet. So you can write your required logic in the processAction() method. Using render you can redirect to required page or jsp.

<form action="<portlet:actionURL ><portlet:param name="action" value="editStocks"/></portlet:actionURL>" method="POST" name ="<portlet:namespace/>fm">

You can also send parameters using <portlet:param> tag.


Thanks,
Srujan Kollisetty
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: liferay portlet - form parameters missing from request
 
Similar Threads
Namespace prefix for form fields..
<when> tags
repalces my #sign with %23 (HEX of #) in URL which i don't want
"struts_action" param inside renderURL tag for liferay's MVCPortlet
EditAction not called on liferay