1 5 6 import java.io.IOException ; 7 8 import javax.portlet.* ; 9 19 public class HelloWorldPortlet extends GenericPortlet { 20 private static final String HELLO_TEMPLATE = 21 "/WEB-INF/templates/html/HelloWorld.jsp"; 22 23 31 public void init(PortletConfig pConfig) throws PortletException 32 { 33 super.init(pConfig); 34 } 35 36 45 public void doView(RenderRequest pRequest, RenderResponse pResponse) 46 throws PortletException, IOException 47 { 48 WindowState state = pRequest.getWindowState(); 49 pResponse.setContentType("text/html"); 50 51 PortletContext context = getPortletContext(); 52 PortletRequestDispatcher rd = context.getRequestDispatcher(HELLO_TEMPLATE); 53 rd.include(pRequest, pResponse); 54 } 55 56 65 public void doEdit(RenderRequest pRequest, RenderResponse pResponse) 66 throws PortletException, IOException 67 { 68 WindowState state = pRequest.getWindowState(); 69 pResponse.setContentType("text/html"); 70 71 PortletContext context = getPortletContext(); 72 PortletRequestDispatcher rd = context.getRequestDispatcher(HELLO_TEMPLATE); 73 rd.include(pRequest, pResponse); 74 75 } 76 77 78 87 public void doHelp(RenderRequest pRequest, RenderResponse pResponse) 88 throws PortletException, IOException 89 { 90 WindowState state = pRequest.getWindowState(); 91 pResponse.setContentType("text/html"); 92 93 PortletContext context = getPortletContext(); 94 PortletRequestDispatcher rd = context.getRequestDispatcher(HELLO_TEMPLATE); 95 rd.include(pRequest, pResponse); 96 } 97 } 98 | Popular Tags |