Portlet is temporarily unavailable

2019-06-05 08:34发布

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条回答
时光不老,我们不散
2楼-- · 2019-06-05 09:12

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)

查看更多
登录 后发表回答