/portal-impl/src/com/liferay/portlet/helloworld/HelloWorldPortlet.java

https://github.com/monicali/liferay-portal · Java · 53 lines · 25 code · 12 blank · 16 comment · 0 complexity · 859f9a4697791f9bb0f0fec43567b59b MD5 · raw file

  1. /**
  2. * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
  3. *
  4. * This library is free software; you can redistribute it and/or modify it under
  5. * the terms of the GNU Lesser General Public License as published by the Free
  6. * Software Foundation; either version 2.1 of the License, or (at your option)
  7. * any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11. * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  12. * details.
  13. */
  14. package com.liferay.portlet.helloworld;
  15. import com.liferay.portal.kernel.util.ContentTypes;
  16. import com.liferay.portal.kernel.util.ReleaseInfo;
  17. import java.io.IOException;
  18. import java.io.PrintWriter;
  19. import javax.portlet.ActionRequest;
  20. import javax.portlet.ActionResponse;
  21. import javax.portlet.GenericPortlet;
  22. import javax.portlet.RenderRequest;
  23. import javax.portlet.RenderResponse;
  24. /**
  25. * @author Brian Wing Shun Chan
  26. */
  27. public class HelloWorldPortlet extends GenericPortlet {
  28. @Override
  29. public void doView(
  30. RenderRequest renderRequest, RenderResponse renderResponse)
  31. throws IOException {
  32. renderResponse.setContentType(ContentTypes.TEXT_HTML_UTF8);
  33. PrintWriter writer = renderResponse.getWriter();
  34. writer.print("Welcome to " + ReleaseInfo.getReleaseInfo() + ".");
  35. writer.close();
  36. }
  37. @Override
  38. public void processAction(
  39. ActionRequest actionRequest, ActionResponse actionResponse) {
  40. }
  41. }