1 16 19 20 package org.apache.pluto.core.impl; 21 22 import java.io.InputStream ; 23 24 import javax.portlet.ActionRequest; 25 import javax.portlet.PortletPreferences; 26 27 import org.apache.pluto.factory.PortletObjectAccess; 28 import org.apache.pluto.om.window.PortletWindow; 29 30 38 public class ActionRequestImpl extends PortletRequestImpl implements ActionRequest 39 { 40 43 private PortletPreferences portletPreferences; 44 45 public ActionRequestImpl(PortletWindow portletWindow, 46 javax.servlet.http.HttpServletRequest servletRequest) 47 { 48 super(portletWindow, servletRequest); 49 } 50 51 55 public InputStream getPortletInputStream () throws java.io.IOException 56 { 57 javax.servlet.http.HttpServletRequest servletRequest = (javax.servlet.http.HttpServletRequest ) super.getRequest(); 58 59 if (servletRequest.getMethod().equals("POST")) 60 { 61 String contentType=servletRequest.getContentType(); 62 if (contentType==null||contentType.equals("application/x-www-form-urlencoded")) 63 { 64 throw new java.lang.IllegalStateException ( 65 "User request HTTP POST data is of type application/x-www-form-urlencoded. This data has been already processed by the portal/portlet-container and is available as request parameters." 66 ); 67 } 68 } 69 return servletRequest.getInputStream(); 70 } 71 72 public PortletPreferences getPreferences() 75 { 76 if (this.portletPreferences == null) 77 { 78 this.portletPreferences = PortletObjectAccess.getPortletPreferences(org.apache.pluto.Constants.METHOD_ACTION, super.getInternalPortletWindow().getPortletEntity()); 79 } 80 return this.portletPreferences; 81 } 82 } 84 | Popular Tags |