Portlet暂时不可用 [英] Portlet is temporarily unavailable
问题描述
按照Liferay在《操作手册》中的说明为portlet编写编辑模式.我已成功部署了Portlet.此portlet在编辑模式下包含一个文本框和一个按钮.如果我在文本框中键入一个名称并按下按钮,则该名称将在portlet的查看模式下显示.但是,当我进入编辑模式并在文本框中键入名称,然后按添加名称"按钮时,会显示"Portlet暂时不可用"消息.
Im following Liferay in Action book instructions to write edit mode for a portlet. I successfully deployed the portlet. This portlet contains a text box and a button in edit mode. If I type a name in the text box and press the button, this name will be shown in view mode of the portlet. But when I go to edit mode and type a name in the text box and press the Add Name button it shows me "Portlet is temporarily unavailable" message.
更新:
我检查了日志文件.它说"javax.portlet.PortletException:processAction方法未实现".但是我已经实现了.
I checked the log file. It says "javax.portlet.PortletException: processAction method not implemented". but I have implemented it.
@Override
public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, PortletException {
String addName = actionRequest.getParameter("addName");
if (addName != null) {
PortletPreferences prefs = actionRequest.getPreferences();
prefs.setValue("name", actionRequest.getParameter("username"));
prefs.store();
actionResponse.setPortletMode(PortletMode.VIEW);
}
}
推荐答案
您可以在日志中找到错误(假设您也使用Tomcat)
You can find the error in the logs (Assuming your also using Tomcat)
- 服务器开启时:liferayfolder/tomcatfolder/logs/catalina.out
- 服务器关闭时:liferayfolder/logs/liferay- 2012-03-11 .log(日期可以更改)
- When server on : liferayfolder/tomcatfolder/logs/catalina.out
- When the server is off: liferayfolder/logs/liferay-2012-03-11.log (date can change)
如果您使用的是Linux或Mac OS,则可以拖尾日志文件以对其进行实时监控.
If you are on linux or mac OS you can tail the logfile to livemonitor it.
例如:tail -f path\to\tomcat\logs\catalina.out
在提供更多信息之前,建议您查看这本书示例并比较代码. (资源>下载>代码示例)
Until more information is provided I suggest you look at the book examples and compare the codes. (Resources > download > code examples)
这篇关于Portlet暂时不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!