Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 807
Prakash K Avatar asked Jul 27 '12 07:07

Prakash K


1 Answers

  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.

like image 123
Prakash K Avatar answered Nov 08 '22 23:11

Prakash K