1 package org.exoplatform.services.portletcontainer.test.portlet; 2 3 import javax.portlet.*; 4 import java.io.IOException ; 5 import java.io.PrintWriter ; 6 7 11 12 19 public class PortletToTestNonPropagationOfActionParamToRender extends GenericPortlet{ 20 21 public void init(PortletConfig portletConfig) throws PortletException { 22 } 23 24 public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) 25 throws PortletException, IOException { 26 String param1 = actionRequest.getParameter("param"); 27 28 if(!"param-value".equals(param1)) 29 throw new PortletException("getParameter does not work"); 30 31 actionResponse.setRenderParameter("status", "Everything is ok"); 32 } 33 34 public void render(RenderRequest renderRequest, RenderResponse renderResponse) 35 throws PortletException, IOException { 36 renderResponse.setContentType("text/html"); 38 String param1 = renderRequest.getParameter("param"); 39 40 if(param1 != null) 41 throw new PortletException("getParameter does not work"); 42 43 PrintWriter w = renderResponse.getWriter(); 44 w.println("Everything is ok"); 45 } 46 47 public void destroy() { 48 } 50 51 } 52 | Popular Tags |