Created
May 30, 2016 17:13
-
-
Save chingovan/bed453a4ed45033bc276b151eeef0656 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.liferay.tutorial; | |
| import java.io.IOException; | |
| import javax.portlet.ActionRequest; | |
| import javax.portlet.ActionResponse; | |
| import javax.portlet.PortletException; | |
| import com.liferay.portal.kernel.util.ParamUtil; | |
| import com.liferay.util.bridges.mvc.MVCPortlet; | |
| /** | |
| * Portlet implementation class SecondPortlet | |
| */ | |
| public class SecondPortlet extends MVCPortlet { | |
| @Override | |
| public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, PortletException { | |
| String name = ParamUtil.getString(actionRequest, "name"); | |
| String message = ""; | |
| if ( name == null || name.isEmpty()) { | |
| message = "Hello World"; | |
| } else { | |
| message = "Hello " + name; | |
| } | |
| actionResponse.setRenderParameter("message", message); | |
| super.processAction(actionRequest, actionResponse); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment