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 PortletToTestPortletURLSecurity implements Portlet{ 20 21 public void init(PortletConfig portletConfig) throws PortletException { 22 } 23 24 public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException, IOException { 25 } 26 27 public void render(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException { 28 renderResponse.setContentType("text/html"); 30 PortletURL pURL = renderResponse.createRenderURL(); 31 32 if(pURL.toString().indexOf("isSecure=true") < 0) 33 throw new PortletException("security does not work : " + pURL.toString()); 34 35 PrintWriter w = renderResponse.getWriter(); 36 w.println("Everything is ok"); 37 38 } 39 40 public void destroy() { 41 } 43 } 44 45 | Popular Tags |