如何禁用默认消息:“您的请求已成功处理"? [英] How to disable default message: "Your request processed successfully"?

查看:82
本文介绍了如何禁用默认消息:“您的请求已成功处理"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当在我的插件portlet中执行添加/更新操作时,如何为我的插件portlet禁用此默认消息:您的请求已成功处理"?

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?

我也想在我的自定义配置页面(configuration.jsp)中禁用此设置,这是当我们单击每个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?

还是可以从我的自定义portlet和ConfigurationActionImpl更改消息?

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

推荐答案

  1. 可以通过portlet.xml中的以下配置对我的Portlet中的所有操作禁用此消息:

  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>

  • 或者,也可以为特定操作而不是所有操作更改它:

  • 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);
    }
    

  • 感谢此链接中显示的信息.

    希望这对某人有帮助.

    这篇关于如何禁用默认消息:“您的请求已成功处理"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆