Skip to content

Instantly share code, notes, and snippets.

@rotty3000
Created September 26, 2011 15:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rotty3000/1242568 to your computer and use it in GitHub Desktop.
Save rotty3000/1242568 to your computer and use it in GitHub Desktop.
fix success message disabling
@@ -22,6 +22,7 @@ import com.liferay.portal.kernel.servlet.ServletResponseUtil;
import com.liferay.portal.kernel.servlet.SessionErrors;
import com.liferay.portal.kernel.servlet.SessionMessages;
import com.liferay.portal.kernel.util.ContentTypes;
+import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.JavaConstants;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.StringPool;
@@ -168,6 +169,20 @@ public class PortletAction extends Action {
protected void addSuccessMessage(
ActionRequest actionRequest, ActionResponse actionResponse) {
+ HttpServletRequest request = PortalUtil.getHttpServletRequest(
+ actionRequest);
+
+ PortletConfig portletConfig = (PortletConfig)request.getAttribute(
+ JavaConstants.JAVAX_PORTLET_CONFIG);
+
+ boolean addProcessActionSuccessMessage = GetterUtil.getBoolean(
+ portletConfig.getInitParameter("add-process-action-success-action"),
+ true);
+
+ if (!addProcessActionSuccessMessage) {
+ return;
+ }
+
String successMessage = ParamUtil.getString(
actionRequest, "successMessage");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment