Posts

Showing posts with the label multiple

Avoiding Multiple Submits(Refresh page) in Liferay

We often see after submitting the form and refresh the page you will see the same result will be adding in the DB. So how to get rid of this? Here we have 2 options to eliminate this behaviour. 1. By Declaring the tag in the liferay-portlet.xml after <icon> tag           <action-url-redirect> true </action-url-redirect> 2.After doing our logic we can redirect to specified URL by using actionResponse.    actionResponse.sendRedirect(PortalUtil.getLayoutURL(themeDisplay.getLayout(),themeDisplay));   Here we are  redirecting to the friendly url of that page. The above will be redirect to the below URL as                     //group/test/test1----- (group/<your-community-name>/pageName) .