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);
}
}
You can find the error in the logs (Assuming your also using Tomcat)
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)