Portlet is temporarily unavailable

五迷三道 提交于 2020-01-03 04:15:36

问题


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.

Update:

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

回答1:


You can find the error in the logs (Assuming your also using Tomcat)

  • When server on : liferayfolder/tomcatfolder/logs/catalina.out
  • When the server is off: liferayfolder/logs/liferay-2012-03-11.log (date can change)

If you are on linux or mac OS you can tail the logfile to livemonitor it.

For example : 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)



来源:https://stackoverflow.com/questions/9648084/portlet-is-temporarily-unavailable

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