1 7 package org.exoplatform.services.portletcontainer.test.portlet; 8 9 import javax.portlet.*; 10 import java.io.IOException ; 11 import java.io.PrintWriter ; 12 import java.util.Enumeration ; 13 14 18 public class HelloWorld2 extends GenericPortlet { 19 20 protected void doView(RenderRequest renderRequest, RenderResponse renderResponse) 21 throws PortletException, IOException { 22 renderResponse.setContentType("text/html"); 23 PrintWriter w = renderResponse.getWriter(); 24 if(renderRequest.getWindowState() == WindowState.MAXIMIZED){ 25 w.print("Everything is ok in Maximized state"); 26 return; 27 } 28 if(!"".equals(renderRequest.getPreferences().getValue("test-prop",""))) { 29 w.print("Everything is more than ok"); 30 return; 31 } 32 w.print("Everything is ok"); 33 } 34 35 protected void doHelp(RenderRequest renderRequest, RenderResponse renderResponse) 36 throws PortletException, IOException { 37 renderResponse.setContentType("text/html"); 38 PrintWriter w = renderResponse.getWriter(); 39 w.print("Everything is ok in Help mode"); 40 } 41 42 public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) 43 throws PortletException, IOException { 44 } 45 46 } 47 | Popular Tags |