1 7 8 package org.exoplatform.services.portletcontainer.test.portlet; 9 10 import javax.portlet.*; 11 import java.io.IOException ; 12 import java.io.PrintWriter ; 13 import java.util.Enumeration ; 14 15 19 public class PortletToTestSession extends GenericPortlet { 20 21 protected void doView(RenderRequest renderRequest, RenderResponse renderResponse) 22 throws PortletException, IOException { 23 renderResponse.setContentType("text/html"); 24 PrintWriter w = renderResponse.getWriter(); 25 PortletSession session = renderRequest.getPortletSession(); 26 if(session.getAttribute("att") == null){ 27 session.setAttribute("att", "attribute set in first call"); 28 } else { 29 w.print(session.getAttribute("att")); 30 } 31 } 32 33 public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) 34 throws PortletException, IOException { 35 } 36 37 } 38 | Popular Tags |