Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

liferay portlet - form parameters missing from request

 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic