Hi,
I'm attempting to use the tc:file / tx:file control to upload a file.
But when I click the button responsible for submitting the page the
associated action is not invoked, the page is refreshed and showed without
any styles (!?).
Without the tx:file-tag everything works fine.
JSP:
<tx:file value="#{controller.fileItem}" required="false" label="Upload file"
/>
<tc:button action="#{controller.save}" label="Save"/>
I have added the following to my web.xml:
<filter>
<filter-name>multipartFormdataFilter</filter-name>
<filter-class>org.apache.myfaces.tobago.webapp.TobagoMultipartFormdataFilter</filter-class>
<init-param>
<description>Set the size limit for uploaded
files...</description>
<param-name>uploadMaxFileSize</param-name>
<param-value>20m</param-value>
</init-param>
<init-param>
<description>Set the upload repository path for uploaded files.
Default value is java.io.tmpdir.</description>
<param-name>uploadRepositoryPath</param-name>
<param-value>c:/tmp</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>multipartFormdataFilter</filter-name>
<url-pattern>/faces/*</url-pattern>
</filter-mapping>
There are no errors or warnings, the debug log says:
...
DEBUG 21 okt 16:38:30
org.apache.myfaces.tobago.webapp.TobagoMultipartFormdataFilter - Wrapping
org.apache.catalina.connector.RequestFacade with
ContentType="multipart/form-data;
boundary=---------------------------209722283024901" into
TobagoMultipartFormdataRequest
...
DEBUG 21 okt 16:38:30
org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.FileRenderer
- Uploaded file name : "image001.gif" size = 5558
...
I'm using Tobago 1.0.23 / MyFaces 1.1.6 / Tomcat 6.0.20 / Java 6u15.
I hope someone can provide a hint. Thanks.
Best regards
Soeren