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.
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.