//Object extendedRequest = portletRequest;
//Object extendedResponse = portletResponse;
//boolean multipartContent = false;
AddResource addResource= AddResourceFactory.getInstance(this);
addResource.responseStarted();
if (addResource.requiresBuffer())
{
throw new IllegalStateException("buffering not supported in the portal environment. "+
" Use for org.apache.myfaces.ADD_RESOURCE_CLASS the value"+
" org.apache.myfaces.renderkit.html.util.NonBufferingAddResource.");
}
//externalContextDelegate = new PortletExternalContextWrapper(
// delegate.getExternalContext(), extendedRequest, extendedResponse, multipartContent);
}
else {
HttpServletResponse httpResponse = (HttpServletResponse) delegate.getExternalContext().getResponse();
HttpServletRequest httpRequest = (HttpServletRequest) delegate.getExternalContext().getRequest();
HttpServletRequest extendedRequest = httpRequest;
// For multipart/form-data requests we need to encapsulate
// the request using MultipartRequestWrapper. This could not be
// done on TomahawkFacesContextFactory.getFacesContext(...)
// because we need an ExternalContext instance to get
// the init params for the ExtensionsFilter and initialize
// MultipartRequestWrapper with the correct values.
boolean multipartContent = false;
if (FileUpload.isMultipartContent(httpRequest)) {
multipartContent = true;
MultipartRequestWrapperConfig config = MultipartRequestWrapperConfig
.getMultipartRequestWrapperConfig(delegate
.getExternalContext());
extendedRequest = new MultipartRequestWrapper(httpRequest, config.getUploadMaxFileSize(),
config.getUploadThresholdSize(), config.getUploadRepositoryPath());
}
AddResource addResource= AddResourceFactory.getInstance(this);
addResource.responseStarted();
if (addResource.requiresBuffer() && extensionsResponseWrapper != null)
{
//If the request requires buffer, this was already
//wrapped (on TomahawkFacesContextFactory.getFacesContext(...) ),
//but we need to save the wrapped response value
//on a local variable to then reference it on release()