Total Pageviews

Tuesday, April 2, 2013

Solution of Duplicate Submission issue of Form on Page Reload

Re submission of form on press of refresh button is an old issue is Liferay. The reason behind this issue is the parameters and action which are available in URL after the form submission.  Earlier some developers used to open some other JSP after completion of Action.

But its solution is a very easy, provided by liferay itself. We have to set the following value in a tag inside liferay-portlet.xml which is set  false by default.


  1. I have same issue in my liferay MVC portlet. I could not rectify this problem yet. My portlet get hanged when i add
    <action-url-redirect > true </action-url-redirect > to liferay-portlet.xml

  2. hi when i used action-url-redirect property true then it work,but side effect here

    in jsp

    List sm=(List)request.getAttribute("search");
    it generate nullpointer exception ,but if i remove action-url-redirect property then it work ,what i should do then both are work fine...

    1. I Set the action-url-redirect value to true liferay-portlet.xml for prevent submission while refreshing the page. Thats work fine, but while retrieve data from request.getAttribute(""); method, its displaying null value. If I removed the action-url-redirect value to true liferay-portlet.xml that displaying value correctly, but it's not working properly while using the action-url-redirect value to true liferay-portlet.xml. I want to use that both, can you please help me on this.

  3. Also it shows the error like "No Bean Found For this Scope"

  4. This comment has been removed by the author.

  5. Hi Apoorva,
    Thanks for the post..

    Please edit the post with the sequence order of the block of code you have shared so that it will be easy for beginner.

    we will have to add the above code just before
    header-portlet-css tag

    Keep Sharing Apoorva..

    1. Sequences can easily be managed in LDS easily. If you are working in overview view, it manages the sequences automatically, and if you are making entry in XML, it will show you error.

  6. This comment has been removed by the author.