1 package org.exoplatform.services.portletcontainer.test.portlet; 2 3 4 import javax.portlet.*; 5 import java.io.IOException ; 6 import java.io.PrintWriter ; 7 8 12 13 20 public class PortletToTestParameterEncoding implements Portlet{ 21 public void init(PortletConfig portletConfig) throws PortletException { 22 } 24 25 public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException, IOException { 26 } 27 28 public void render(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException { 29 30 renderResponse.setContentType("text/html"); 32 PortletURL pURL = renderResponse.createRenderURL(); 33 pURL.setParameter("a test", "a Test"); 34 35 36 if(pURL.toString().indexOf("a+test=a+Test") < 0) 37 throw new PortletException("getParameter does not work : " + pURL.toString()); 38 39 PrintWriter w = renderResponse.getWriter(); 40 w.println("Everything is ok"); 41 } 42 43 public void destroy() { 44 } 46 } | Popular Tags |