How to disable default message: "Your request processed successfully"?

Prakash K picture Prakash K · Jul 27, 2012 · Viewed 9.4k times · Source

How would I disable this default message: "Your request processed successfully" for my plugin portlet when an add/update action is performed in my portlet?

Also I would want to disable this for my custom configuration page (configuration.jsp), this is the configuration page which is shown when we click on the wrench icon which appears on the top-right corner of every portlet.

Is there a configuration option anywhere which I can set or some code which I can write to disable it?

Or else would it be possible to change the message from my custom portlet and ConfigurationActionImpl?

Answer

Prakash K picture Prakash K · Jul 27, 2012
  1. This message can be disabled for all actions in my portlet through the following configuration in portlet.xml:

    <init-param>
        <name>add-process-action-success-action</name>
        <value>false</value>
    </init-param>
    
  2. Alternatively it can also be changed for a particular action rather than for all actions:

    public void addEmployee(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, PortletException {
    
        // ... all the code processing
    
        String successMsg = "Employee added Successfully!";
    
        SessionMessages.add(actionRequest, "request_processed", successMsg);
    }
    

Thanks to the information present in this link.

Hope this helps someone.