在我的portlet中执行添加/更新操作时,如何禁用此默认消息:"我的请求已成功处理"我的插件portlet?
此外,我想为我的自定义配置页面(configuration.jsp)禁用此功能,这是当我们点击每个portlet右上角出现的扳手图标时显示的配置页面.
是否有我可以设置的配置选项或我可以编写的一些代码来禁用它?
或者是否可以从我的自定义portlet更改消息ConfigurationActionImpl?
Pra*_*h K 20
可以通过以下配置为我的portlet中的所有操作禁用此消息portlet.xml:
<init-param>
<name>add-process-action-success-action</name>
<value>false</value>
</init-param>
Run Code Online (Sandbox Code Playgroud)或者,它也可以针对特定操作而不是针对所有操作进行更改:
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);
}
Run Code Online (Sandbox Code Playgroud)感谢此链接中提供的信息.
希望这有助于某人.