@Override public void decode(FacesContext context, UIComponent component) { if (!context.getExternalContext().getRequestContentType().toLowerCase().startsWith("multipart/")) { return; } FileUpload fileUpload = (FileUpload) component; if (!fileUpload.isDisabled()) { PrimeApplicationContext applicationContext = PrimeApplicationContext.getCurrentInstance(context); String uploader = applicationContext.getConfig().getUploader(); boolean isAtLeastJSF22 = applicationContext.getEnvironment().isAtLeastJsf22(); String inputToDecodeId = getSimpleInputDecodeId(fileUpload, context); if (uploader.equals("auto")) { if (isAtLeastJSF22) { NativeFileUploadDecoder.decode(context, fileUpload, inputToDecodeId); } else { CommonsFileUploadDecoder.decode(context, fileUpload, inputToDecodeId); } } else if (uploader.equals("native")) { if (!isAtLeastJSF22) { throw new FacesException("native uploader requires at least a JSF 2.2 runtime"); } NativeFileUploadDecoder.decode(context, fileUpload, inputToDecodeId); } else if (uploader.equals("commons")) { CommonsFileUploadDecoder.decode(context, fileUpload, inputToDecodeId); } } }
/** * {@inheritDoc} */ @Override public String getRequestContentType() { return wrapped.getRequestContentType(); }
@Override public String getRequestContentType() { return wrapped.getRequestContentType(); }
/** * {@inheritDoc} */ @Override public String getRequestContentType() { return wrapped.getRequestContentType(); }
/** * {@inheritDoc} */ @Override public String getRequestContentType() { return wrapped.getRequestContentType(); }
public String getRequestContentType() { return delegate.getRequestContentType(); }
/** * Returns the content type from the current externalContext or * <code>null</code> if unknown. * * @param ec the current external context * @return a String contining the the content type or <code>null</code> * @see ExternalContext#getRequestContentType() * * @deprecated use ExternalContext.getRequestContentType() */ @Deprecated public static String getContentType(ExternalContext ec) { return ec.getRequestContentType(); }
public String getRequestContentType() { ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get(); if (ctx == null) { throw new UnsupportedOperationException(); } return ctx.getRequestContentType(); }
/** * <p>The default behavior of this method is to * call {@link ExternalContext#getRequestContentType} * on the wrapped {@link ExternalContext} object.</p> * * @see javax.faces.context.ExternalContext#getRequestContentType() */ @Override public String getRequestContentType() { return getWrapped().getRequestContentType(); }
@Override public void decode(FacesContext context, UIComponent component) { if (context.getExternalContext().getRequestContentType().toLowerCase().startsWith("multipart/")) { super.decode(context, component); } }
/** * <p>The default behavior of this method is to * call {@link ExternalContext#getRequestContentType} * on the wrapped {@link ExternalContext} object.</p> * * @see javax.faces.context.ExternalContext#getRequestContentType() */ @Override public String getRequestContentType() { return getWrapped().getRequestContentType(); }
/** * <p>The default behavior of this method is to * call {@link ExternalContext#getRequestContentType} * on the wrapped {@link ExternalContext} object.</p> * * @see javax.faces.context.ExternalContext#getRequestContentType() */ @Override public String getRequestContentType() { return getWrapped().getRequestContentType(); }
/** * <p>The default behavior of this method is to * call {@link ExternalContext#getRequestContentType} * on the wrapped {@link ExternalContext} object.</p> * * @see javax.faces.context.ExternalContext#getRequestContentType() */ @Override public String getRequestContentType() { return getWrapped().getRequestContentType(); }
/** * <p>The default behavior of this method is to * call {@link ExternalContext#getRequestContentType} * on the wrapped {@link ExternalContext} object.</p> * * @see javax.faces.context.ExternalContext#getRequestContentType() */ @Override public String getRequestContentType() { return getWrapped().getRequestContentType(); }
@Override public String getRequestContentType() { return getWrapped().getRequestContentType(); }
/** * <p>The default behavior of this method is to * call {@link ExternalContext#getRequestContentType} * on the wrapped {@link ExternalContext} object.</p> * * @see javax.faces.context.ExternalContext#getRequestContentType() */ @Override public String getRequestContentType() { return getWrapped().getRequestContentType(); }
/** * <p>The default behavior of this method is to * call {@link ExternalContext#getRequestContentType} * on the wrapped {@link ExternalContext} object.</p> * * @see javax.faces.context.ExternalContext#getRequestContentType() */ @Override public String getRequestContentType() { return getWrapped().getRequestContentType(); }
/** * <p>The default behavior of this method is to * call {@link ExternalContext#getRequestContentType} * on the wrapped {@link ExternalContext} object.</p> * * @see javax.faces.context.ExternalContext#getRequestContentType() */ @Override public String getRequestContentType() { return getWrapped().getRequestContentType(); }
/** * <p>The default behavior of this method is to * call {@link ExternalContext#getRequestContentType} * on the wrapped {@link ExternalContext} object.</p> * * @see javax.faces.context.ExternalContext#getRequestContentType() */ @Override public String getRequestContentType() { return getWrapped().getRequestContentType(); }
public java.lang.String getContentType() { //Normally we'd rely on the ExternalContext but the portlet bridge returns //an incorrect content-type for the Ajax request used for fileUpload so we //rely on the underlying request value if possible. Object result = getMethodAndInvoke(externalContext.getRequest(),"getContentType"); if( result != null ){ return (String)result; } return externalContext.getRequestContentType(); }