1
votes

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
Can you show exception that you've got.Martin Gamulin
I dont see any exception. After deploying the portlet I open the liferay and add the portlet to my portal. Then I go to edit mode of the portlet and type a name in the edit box and hit the Add Name botton. when it is switching back to view mode it shows the message.Karadous
in liferay's log file you should see exception. Also can you show your render (view) handler? Or if you are following the example word for word, can you tell which page it is on?Martin Gamulin
Portlet is temporarily unavailable is Liferay's friendly way of telling you an exception has been thrown in the background. So as Martin says we need to see the exception in the logsJonny
I cehcked the log file. It says "javax.portlet.PortletException: processAction method not implemented". but I have implemented it. This is the implementation:Karadous

1 Answers

2
votes

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)