myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Commented] (TOBAGO-1539) Using Servlet 3.0 for uploading files with <tc:file>
Date Fri, 04 Mar 2016 17:15:40 GMT

    [ https://issues.apache.org/jira/browse/TOBAGO-1539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15180174#comment-15180174
] 

Hudson commented on TOBAGO-1539:
--------------------------------

FAILURE: Integrated in Tobago 3.0.x #259 (See [https://builds.apache.org/job/Tobago%203.0.x/259/])
TOBAGO-1539: Using Servlet 3.0 for uploading files with <tc:file>
* don't save state for the Part: this fixes a problem after failed validation (lofwyr: [http://svn.apache.org/viewvc/?view=rev&rev=1733614])
* tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/FileRenderer.java
* tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/util/HttpPartWrapper.java


> Using Servlet 3.0 for uploading files with <tc:file>
> ----------------------------------------------------
>
>                 Key: TOBAGO-1539
>                 URL: https://issues.apache.org/jira/browse/TOBAGO-1539
>             Project: MyFaces Tobago
>          Issue Type: New Feature
>          Components: Core, Demo, Themes
>            Reporter: Udo Schnurpfeil
>            Assignee: Udo Schnurpfeil
>             Fix For: 3.0.0-alpha-3, 3.0.0
>
>
> Changes regarding to Tobago 2.0.x:
>   * You no long need to define a TobagoMultipartFormdataFilter in the web.xml
>   * There is no longer a tobago-fileupload.jar
>   * Remove the dependency to commons-fileupload.jar in your web app, if there is any.
> Usage:
>   * If using JSF 2.0 or 2.1 (not for 2.2. and higher) you will need to add a tag <multipart-config>
Tag to the FacesServlet config in the web.xml
> {code}
>   <servlet>
>     <servlet-name>FacesServlet</servlet-name>
>     <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
>     <multipart-config>
>       <location>/tmp</location>
>       <max-file-size>20848820</max-file-size>
>       <max-request-size>418018841</max-request-size>
>       <file-size-threshold>1048576</file-size-threshold>
>     </multipart-config>
>   </servlet>
> {code}
>   * The type of value of the <tc:file> has been changed from *org.apache.commons.fileupload.FileItem*
to *javax.servlet.http.Part*.
>   * To access from the Java bean see this example:
> {code}
>   private Part file1; // + getter and setter
>    
>   public String upload() {
>     InputStream is = part.getInputStream();
>     ...
>   } 
> {code}
>   * Is using Servlet API 3.1 you may call *part.getSubmittedFileName()*, for 3.0 you
may use the Utility *org.apache.myfaces.tobago.internal.util.PartUtils.getSubmittedFileName(part)*



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message