How to disable default message: “Your request processed successfully”?

一世执手 提交于 2019-12-04 20:11:20

问题


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?


回答1:


  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.



来源:https://stackoverflow.com/questions/11683652/how-to-disable-default-message-your-request-processed-successfully

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!