You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by pokkie <po...@gmail.com> on 2006/06/16 18:32:47 UTC

InputFileUpload/UploadedFile returns null

Hello all,

For some reason, when my form is submitted, the setter in my backing bean
that is tied 
to my inputFileUpload component isn't called, and subsequently, any attempt
of 
retrieving a reference is also returned as 'null'

JSP
-----
<h:form id="createEmailForm" enctype="multipart/form-data">
        <f:verbatim>
            E-Mail Attachment (1) :
        </f:verbatim>
        <t:inputFileUpload id="uploadFile1" value="#{emailBean.uploadFile1}"
storage="file" size="30" style="width:305px; background:#f5f5f5;"/>

      <t:commandButton id="updateEmailDetails"
                       value="Update E-Mail Details"
                       actionListener="#{emailBean.updateEmailDetails}"
                       styleClass="submit"
                       rendered="#{emailBean.emailDetails}"/>
</h:form>

Backing Bean
-------------------
private UploadedFile uploadFile1;

public UploadedFile getUploadFile1() {
        logger.debug("getter is invoked, upload 1");
        return uploadFile1;
    }

    public void setUploadFile1(UploadedFile uploadFile1) {
        logger.debug("setter is invoked, upload 1");
        this.uploadFile1 = uploadFile1;
    }

// Form ActionListener
public void updateEmailDetails(ActionEvent actionEvent) {
        logger.debug("file upload is : " + getUploadFile1()); // returns
null
    }

web.xml
------------
<filter>
        <filter-name>MyFacesExtensionsFilter</filter-name>
       
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
        <init-param>
            <param-name>uploadMaxFileSize</param-name>
            <param-value>20m</param-value>
        </init-param>
        <init-param>
            <param-name>uploadThresholdSize</param-name>
            <param-value>100k</param-value>
        </init-param>
        <init-param>
            <param-name>uploadRepositoryPath</param-name>
            <param-value>/home/behemoth/temp</param-value>
        </init-param>
    </filter>

I am using the latest, 16 June 2006, snapshot versions of tomahawk and
myfaces. 
Originally I was using tomahawk 1.1.2 and a snapshot of myfaces 30 April
2006, but 
since the replacement, the problem stays the same. Furthermore, I have
enabled logging
on myfaces and the apache packages with level of DEBUG and neither have
releaved 
any clues as to why this is not working.

Any help would be much appreciated,

-- Pokkie




--
View this message in context: http://www.nabble.com/InputFileUpload-UploadedFile-returns-null-t1799337.html#a4903754
Sent from the MyFaces - Users forum at Nabble.com.


Re: Tomahawk & Spring Webflow : enctype="multipart/form-data" doesnt work

Posted by Simon Kitching <sk...@apache.org>.
Yes, something on the wiki would be nice.

The point is that the ExtensionsFilter needs to be mapped to *whatever
servlet handles the faces request*. In almost every case this is the
Faces Servlet (duh). But occasionally it is not, like here with WebFlow.
And as it happens, the in-house webapp I work on for my employer also
has an architecture where a custom servlet handles requests, then
forwards internally to the Faces Servlet. So the Spring WebFlow setup
isn't entirely unique.

Cheers,
Simon

Matthias Wessendorf schrieb:
> thanks!
>
> do you mind to document this in the wiki ?
> I heard that the spring wf does some wild stuff, and since you figured,
> it would be great to create a wiki page for that!
>
> thanks!
> Matthias
>
> On Wed, Nov 5, 2008 at 9:57 PM, djohnjimmy <dj...@gmail.com> wrote:
>   
>> I got it working now.
>>
>> The problem was that...
>>
>> "When Spring Web Flow comes into picture, the faces Servlet is not the big
>> guy delivering the views - its Spring's MVC Dispatcher Servlet that serves
>> the requests"
>>
>> Although, everyone advises Tomahawk Extensions Filter to be mapped to Faces
>> Servlet. That doesnt serve well when we have SWF in between. So, instead of
>> the following fliter-mapping in web.xml.
>>
>> <filter-mapping>
>> <filter-name>Extensions Filter</filter-name>
>> <servlet-name>Faces Servlet</servlet-name>
>> </filter-mapping>
>>
>> Try this :
>> <filter-mapping>
>> <filter-name>Extensions Filter</filter-name>
>> <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
>> </filter-mapping>
>>
>> <!-- Map all /spring requests to the Dispatcher Servlet for handling -->
>> <servlet-mapping>
>> <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
>> <url-pattern>/spring/*</url-pattern>
>> </servlet-mapping>
>>
>> <filter>
>> <filter-name>Extensions Filter</filter-name>
>> <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
>> <init-param>
>> <description>
>> Set the size limit for uploaded files.
>> Format: 10 - 10 bytes
>> 10k - 10 KB
>> 10m - 10 MB
>> 1g - 1 GB
>> </description>
>> <param-name>uploadMaxFileSize</param-name>
>> <param-value>100m</param-value>
>> </init-param>
>> <init-param>
>> <description>
>> Set the threshold size - files below this limit are stored
>> in memory, files above this limit are stored on disk.
>> Format: 10 - 10 bytes
>> 10k - 10 KB
>> 10m - 10 MB
>> 1g - 1 GB
>> </description>
>> <param-name>uploadThresholdSize</param-name>
>> <param-value>100k</param-value>
>> </init-param>
>> <init-param>
>> <description>
>> Set the path where the intermediary files will be stored.
>> </description>
>> <param-name>uploadRepositoryPath</param-name>
>> <param-value>/temp</param-value>
>> </init-param>
>> </filter>
>>
>>
>> djohnjimmy wrote:
>>     
>>> Can someone please take a look at this. I am stuck BIG time. Thanks!
>>>
>>>
>>> djohnjimmy wrote:
>>>       
>>>> My uploadedFile is null.
>>>>
>>>> If I put the  <h:form enctype="multipart/form-data"> then the page never
>>>> goes to the next view. If the enctype="plain/text" then it navigation
>>>> works but the uploadedFile is null.
>>>>
>>>> Environment :
>>>>  Spring WebFlow : 2.0.3.Release
>>>>  Myfaces : 1.2.4
>>>>  Tomahawk : 1.1.6
>>>>  tomahawk-facelets (google project) : 1.1.6.2
>>>>  Websphere AS : 6.1.0.17
>>>>
>>>>
>>>> My web.xml
>>>>  http://www.nabble.com/file/p20333785/web.xml web.xml
>>>>
>>>> Webflow xml
>>>>  http://www.nabble.com/file/p20333785/upload.xml upload.xml .
>>>>
>>>> The upload xhtml (I am using facelets and not jsp)
>>>>  http://www.nabble.com/file/p20333785/csvUpload.xhtml csvUpload.xhtml
>>>>
>>>> The backend bean :
>>>>  http://www.nabble.com/file/p20333785/UploadCSV.java UploadCSV.java
>>>>
>>>> The POJO that I am populating with the CSV values :
>>>>  http://www.nabble.com/file/p20333785/CSVPractice.java CSVPractice.java
>>>>
>>>> The uploaded CSV details in the 2nd Page : // It uses a h:dataTable to
>>>> display the CSV data uploaded in the previous page i.e. csvUpload.xhtml
>>>>  http://www.nabble.com/file/p20333785/uploadedCSVDetails.xhtml
>>>> uploadedCSVDetails.xhtml
>>>>
>>>>
>>>>         
>>>       
>> --
>> View this message in context: http://www.nabble.com/InputFileUpload-UploadedFile-returns-null-tp4903754p20349023.html
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
>>     
>
>
>
>   


-- 
-- Emails in "mixed" posting style will be ignored
-- (http://en.wikipedia.org/wiki/Posting_style)


Re: Tomahawk & Spring Webflow : enctype="multipart/form-data" doesnt work

Posted by Matthias Wessendorf <ma...@apache.org>.
wiki.apache.org/myfaces

On Thu, Nov 6, 2008 at 6:19 PM, djohnjimmy <dj...@gmail.com> wrote:
>
>  Sure, I am actually planning to put it up in our company's wiki. But which
> wiki are you talking about. Give me the links please.
>
>
>
> Matthias Wessendorf-4 wrote:
>>
>> thanks!
>>
>> do you mind to document this in the wiki ?
>> I heard that the spring wf does some wild stuff, and since you figured,
>> it would be great to create a wiki page for that!
>>
>> thanks!
>> Matthias
>>
>> On Wed, Nov 5, 2008 at 9:57 PM, djohnjimmy <dj...@gmail.com> wrote:
>>>
>>> I got it working now.
>>>
>>> The problem was that...
>>>
>>> "When Spring Web Flow comes into picture, the faces Servlet is not the
>>> big
>>> guy delivering the views - its Spring's MVC Dispatcher Servlet that
>>> serves
>>> the requests"
>>>
>>> Although, everyone advises Tomahawk Extensions Filter to be mapped to
>>> Faces
>>> Servlet. That doesnt serve well when we have SWF in between. So, instead
>>> of
>>> the following fliter-mapping in web.xml.
>>>
>>> <filter-mapping>
>>> <filter-name>Extensions Filter</filter-name>
>>> <servlet-name>Faces Servlet</servlet-name>
>>> </filter-mapping>
>>>
>>> Try this :
>>> <filter-mapping>
>>> <filter-name>Extensions Filter</filter-name>
>>> <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
>>> </filter-mapping>
>>>
>>> <!-- Map all /spring requests to the Dispatcher Servlet for handling -->
>>> <servlet-mapping>
>>> <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
>>> <url-pattern>/spring/*</url-pattern>
>>> </servlet-mapping>
>>>
>>> <filter>
>>> <filter-name>Extensions Filter</filter-name>
>>> <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
>>> <init-param>
>>> <description>
>>> Set the size limit for uploaded files.
>>> Format: 10 - 10 bytes
>>> 10k - 10 KB
>>> 10m - 10 MB
>>> 1g - 1 GB
>>> </description>
>>> <param-name>uploadMaxFileSize</param-name>
>>> <param-value>100m</param-value>
>>> </init-param>
>>> <init-param>
>>> <description>
>>> Set the threshold size - files below this limit are stored
>>> in memory, files above this limit are stored on disk.
>>> Format: 10 - 10 bytes
>>> 10k - 10 KB
>>> 10m - 10 MB
>>> 1g - 1 GB
>>> </description>
>>> <param-name>uploadThresholdSize</param-name>
>>> <param-value>100k</param-value>
>>> </init-param>
>>> <init-param>
>>> <description>
>>> Set the path where the intermediary files will be stored.
>>> </description>
>>> <param-name>uploadRepositoryPath</param-name>
>>> <param-value>/temp</param-value>
>>> </init-param>
>>> </filter>
>>>
>>>
>>> djohnjimmy wrote:
>>>>
>>>> Can someone please take a look at this. I am stuck BIG time. Thanks!
>>>>
>>>>
>>>> djohnjimmy wrote:
>>>>>
>>>>> My uploadedFile is null.
>>>>>
>>>>> If I put the  <h:form enctype="multipart/form-data"> then the page
>>>>> never
>>>>> goes to the next view. If the enctype="plain/text" then it navigation
>>>>> works but the uploadedFile is null.
>>>>>
>>>>> Environment :
>>>>>  Spring WebFlow : 2.0.3.Release
>>>>>  Myfaces : 1.2.4
>>>>>  Tomahawk : 1.1.6
>>>>>  tomahawk-facelets (google project) : 1.1.6.2
>>>>>  Websphere AS : 6.1.0.17
>>>>>
>>>>>
>>>>> My web.xml
>>>>>  http://www.nabble.com/file/p20333785/web.xml web.xml
>>>>>
>>>>> Webflow xml
>>>>>  http://www.nabble.com/file/p20333785/upload.xml upload.xml .
>>>>>
>>>>> The upload xhtml (I am using facelets and not jsp)
>>>>>  http://www.nabble.com/file/p20333785/csvUpload.xhtml csvUpload.xhtml
>>>>>
>>>>> The backend bean :
>>>>>  http://www.nabble.com/file/p20333785/UploadCSV.java UploadCSV.java
>>>>>
>>>>> The POJO that I am populating with the CSV values :
>>>>>  http://www.nabble.com/file/p20333785/CSVPractice.java CSVPractice.java
>>>>>
>>>>> The uploaded CSV details in the 2nd Page : // It uses a h:dataTable to
>>>>> display the CSV data uploaded in the previous page i.e. csvUpload.xhtml
>>>>>  http://www.nabble.com/file/p20333785/uploadedCSVDetails.xhtml
>>>>> uploadedCSVDetails.xhtml
>>>>>
>>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/InputFileUpload-UploadedFile-returns-null-tp4903754p20349023.html
>>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Matthias Wessendorf
>>
>> blog: http://matthiaswessendorf.wordpress.com/
>> sessions: http://www.slideshare.net/mwessendorf
>> twitter: http://twitter.com/mwessendorf
>>
>>
>
> --
> View this message in context: http://www.nabble.com/InputFileUpload-UploadedFile-returns-null-tp4903754p20365541.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf

Re: Tomahawk & Spring Webflow : enctype="multipart/form-data" doesnt work

Posted by djohnjimmy <dj...@gmail.com>.
 Sure, I am actually planning to put it up in our company's wiki. But which
wiki are you talking about. Give me the links please.



Matthias Wessendorf-4 wrote:
> 
> thanks!
> 
> do you mind to document this in the wiki ?
> I heard that the spring wf does some wild stuff, and since you figured,
> it would be great to create a wiki page for that!
> 
> thanks!
> Matthias
> 
> On Wed, Nov 5, 2008 at 9:57 PM, djohnjimmy <dj...@gmail.com> wrote:
>>
>> I got it working now.
>>
>> The problem was that...
>>
>> "When Spring Web Flow comes into picture, the faces Servlet is not the
>> big
>> guy delivering the views - its Spring's MVC Dispatcher Servlet that
>> serves
>> the requests"
>>
>> Although, everyone advises Tomahawk Extensions Filter to be mapped to
>> Faces
>> Servlet. That doesnt serve well when we have SWF in between. So, instead
>> of
>> the following fliter-mapping in web.xml.
>>
>> <filter-mapping>
>> <filter-name>Extensions Filter</filter-name>
>> <servlet-name>Faces Servlet</servlet-name>
>> </filter-mapping>
>>
>> Try this :
>> <filter-mapping>
>> <filter-name>Extensions Filter</filter-name>
>> <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
>> </filter-mapping>
>>
>> <!-- Map all /spring requests to the Dispatcher Servlet for handling -->
>> <servlet-mapping>
>> <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
>> <url-pattern>/spring/*</url-pattern>
>> </servlet-mapping>
>>
>> <filter>
>> <filter-name>Extensions Filter</filter-name>
>> <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
>> <init-param>
>> <description>
>> Set the size limit for uploaded files.
>> Format: 10 - 10 bytes
>> 10k - 10 KB
>> 10m - 10 MB
>> 1g - 1 GB
>> </description>
>> <param-name>uploadMaxFileSize</param-name>
>> <param-value>100m</param-value>
>> </init-param>
>> <init-param>
>> <description>
>> Set the threshold size - files below this limit are stored
>> in memory, files above this limit are stored on disk.
>> Format: 10 - 10 bytes
>> 10k - 10 KB
>> 10m - 10 MB
>> 1g - 1 GB
>> </description>
>> <param-name>uploadThresholdSize</param-name>
>> <param-value>100k</param-value>
>> </init-param>
>> <init-param>
>> <description>
>> Set the path where the intermediary files will be stored.
>> </description>
>> <param-name>uploadRepositoryPath</param-name>
>> <param-value>/temp</param-value>
>> </init-param>
>> </filter>
>>
>>
>> djohnjimmy wrote:
>>>
>>> Can someone please take a look at this. I am stuck BIG time. Thanks!
>>>
>>>
>>> djohnjimmy wrote:
>>>>
>>>> My uploadedFile is null.
>>>>
>>>> If I put the  <h:form enctype="multipart/form-data"> then the page
>>>> never
>>>> goes to the next view. If the enctype="plain/text" then it navigation
>>>> works but the uploadedFile is null.
>>>>
>>>> Environment :
>>>>  Spring WebFlow : 2.0.3.Release
>>>>  Myfaces : 1.2.4
>>>>  Tomahawk : 1.1.6
>>>>  tomahawk-facelets (google project) : 1.1.6.2
>>>>  Websphere AS : 6.1.0.17
>>>>
>>>>
>>>> My web.xml
>>>>  http://www.nabble.com/file/p20333785/web.xml web.xml
>>>>
>>>> Webflow xml
>>>>  http://www.nabble.com/file/p20333785/upload.xml upload.xml .
>>>>
>>>> The upload xhtml (I am using facelets and not jsp)
>>>>  http://www.nabble.com/file/p20333785/csvUpload.xhtml csvUpload.xhtml
>>>>
>>>> The backend bean :
>>>>  http://www.nabble.com/file/p20333785/UploadCSV.java UploadCSV.java
>>>>
>>>> The POJO that I am populating with the CSV values :
>>>>  http://www.nabble.com/file/p20333785/CSVPractice.java CSVPractice.java
>>>>
>>>> The uploaded CSV details in the 2nd Page : // It uses a h:dataTable to
>>>> display the CSV data uploaded in the previous page i.e. csvUpload.xhtml
>>>>  http://www.nabble.com/file/p20333785/uploadedCSVDetails.xhtml
>>>> uploadedCSVDetails.xhtml
>>>>
>>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/InputFileUpload-UploadedFile-returns-null-tp4903754p20349023.html
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Matthias Wessendorf
> 
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
> 
> 

-- 
View this message in context: http://www.nabble.com/InputFileUpload-UploadedFile-returns-null-tp4903754p20365541.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Tomahawk & Spring Webflow : enctype="multipart/form-data" doesnt work

Posted by Matthias Wessendorf <ma...@apache.org>.
thanks!

do you mind to document this in the wiki ?
I heard that the spring wf does some wild stuff, and since you figured,
it would be great to create a wiki page for that!

thanks!
Matthias

On Wed, Nov 5, 2008 at 9:57 PM, djohnjimmy <dj...@gmail.com> wrote:
>
> I got it working now.
>
> The problem was that...
>
> "When Spring Web Flow comes into picture, the faces Servlet is not the big
> guy delivering the views - its Spring's MVC Dispatcher Servlet that serves
> the requests"
>
> Although, everyone advises Tomahawk Extensions Filter to be mapped to Faces
> Servlet. That doesnt serve well when we have SWF in between. So, instead of
> the following fliter-mapping in web.xml.
>
> <filter-mapping>
> <filter-name>Extensions Filter</filter-name>
> <servlet-name>Faces Servlet</servlet-name>
> </filter-mapping>
>
> Try this :
> <filter-mapping>
> <filter-name>Extensions Filter</filter-name>
> <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
> </filter-mapping>
>
> <!-- Map all /spring requests to the Dispatcher Servlet for handling -->
> <servlet-mapping>
> <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
> <url-pattern>/spring/*</url-pattern>
> </servlet-mapping>
>
> <filter>
> <filter-name>Extensions Filter</filter-name>
> <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
> <init-param>
> <description>
> Set the size limit for uploaded files.
> Format: 10 - 10 bytes
> 10k - 10 KB
> 10m - 10 MB
> 1g - 1 GB
> </description>
> <param-name>uploadMaxFileSize</param-name>
> <param-value>100m</param-value>
> </init-param>
> <init-param>
> <description>
> Set the threshold size - files below this limit are stored
> in memory, files above this limit are stored on disk.
> Format: 10 - 10 bytes
> 10k - 10 KB
> 10m - 10 MB
> 1g - 1 GB
> </description>
> <param-name>uploadThresholdSize</param-name>
> <param-value>100k</param-value>
> </init-param>
> <init-param>
> <description>
> Set the path where the intermediary files will be stored.
> </description>
> <param-name>uploadRepositoryPath</param-name>
> <param-value>/temp</param-value>
> </init-param>
> </filter>
>
>
> djohnjimmy wrote:
>>
>> Can someone please take a look at this. I am stuck BIG time. Thanks!
>>
>>
>> djohnjimmy wrote:
>>>
>>> My uploadedFile is null.
>>>
>>> If I put the  <h:form enctype="multipart/form-data"> then the page never
>>> goes to the next view. If the enctype="plain/text" then it navigation
>>> works but the uploadedFile is null.
>>>
>>> Environment :
>>>  Spring WebFlow : 2.0.3.Release
>>>  Myfaces : 1.2.4
>>>  Tomahawk : 1.1.6
>>>  tomahawk-facelets (google project) : 1.1.6.2
>>>  Websphere AS : 6.1.0.17
>>>
>>>
>>> My web.xml
>>>  http://www.nabble.com/file/p20333785/web.xml web.xml
>>>
>>> Webflow xml
>>>  http://www.nabble.com/file/p20333785/upload.xml upload.xml .
>>>
>>> The upload xhtml (I am using facelets and not jsp)
>>>  http://www.nabble.com/file/p20333785/csvUpload.xhtml csvUpload.xhtml
>>>
>>> The backend bean :
>>>  http://www.nabble.com/file/p20333785/UploadCSV.java UploadCSV.java
>>>
>>> The POJO that I am populating with the CSV values :
>>>  http://www.nabble.com/file/p20333785/CSVPractice.java CSVPractice.java
>>>
>>> The uploaded CSV details in the 2nd Page : // It uses a h:dataTable to
>>> display the CSV data uploaded in the previous page i.e. csvUpload.xhtml
>>>  http://www.nabble.com/file/p20333785/uploadedCSVDetails.xhtml
>>> uploadedCSVDetails.xhtml
>>>
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/InputFileUpload-UploadedFile-returns-null-tp4903754p20349023.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf

Re: Tomahawk & Spring Webflow : enctype="multipart/form-data" doesnt work

Posted by djohnjimmy <dj...@gmail.com>.
I got it working now.

The problem was that...

"When Spring Web Flow comes into picture, the faces Servlet is not the big
guy delivering the views - its Spring's MVC Dispatcher Servlet that serves
the requests"

Although, everyone advises Tomahawk Extensions Filter to be mapped to Faces
Servlet. That doesnt serve well when we have SWF in between. So, instead of
the following fliter-mapping in web.xml.

<filter-mapping>
<filter-name>Extensions Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>

Try this :
<filter-mapping>
<filter-name>Extensions Filter</filter-name>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
</filter-mapping>

<!-- Map all /spring requests to the Dispatcher Servlet for handling -->
<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>/spring/*</url-pattern>
</servlet-mapping>

<filter>
<filter-name>Extensions Filter</filter-name>
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
<init-param>
<description>
Set the size limit for uploaded files.
Format: 10 - 10 bytes
10k - 10 KB
10m - 10 MB
1g - 1 GB
</description>
<param-name>uploadMaxFileSize</param-name>
<param-value>100m</param-value>
</init-param>
<init-param>
<description>
Set the threshold size - files below this limit are stored
in memory, files above this limit are stored on disk.
Format: 10 - 10 bytes
10k - 10 KB
10m - 10 MB
1g - 1 GB
</description>
<param-name>uploadThresholdSize</param-name>
<param-value>100k</param-value>
</init-param>
<init-param>
<description>
Set the path where the intermediary files will be stored.
</description>
<param-name>uploadRepositoryPath</param-name>
<param-value>/temp</param-value>
</init-param>
</filter> 


djohnjimmy wrote:
> 
> Can someone please take a look at this. I am stuck BIG time. Thanks!
> 
> 
> djohnjimmy wrote:
>> 
>> My uploadedFile is null.
>> 
>> If I put the  <h:form enctype="multipart/form-data"> then the page never
>> goes to the next view. If the enctype="plain/text" then it navigation
>> works but the uploadedFile is null.
>> 
>> Environment :
>>  Spring WebFlow : 2.0.3.Release
>>  Myfaces : 1.2.4
>>  Tomahawk : 1.1.6
>>  tomahawk-facelets (google project) : 1.1.6.2
>>  Websphere AS : 6.1.0.17
>>  
>> 
>> My web.xml
>>  http://www.nabble.com/file/p20333785/web.xml web.xml 
>> 
>> Webflow xml
>>  http://www.nabble.com/file/p20333785/upload.xml upload.xml .
>> 
>> The upload xhtml (I am using facelets and not jsp)
>>  http://www.nabble.com/file/p20333785/csvUpload.xhtml csvUpload.xhtml 
>> 
>> The backend bean :
>>  http://www.nabble.com/file/p20333785/UploadCSV.java UploadCSV.java 
>> 
>> The POJO that I am populating with the CSV values : 
>>  http://www.nabble.com/file/p20333785/CSVPractice.java CSVPractice.java 
>> 
>> The uploaded CSV details in the 2nd Page : // It uses a h:dataTable to
>> display the CSV data uploaded in the previous page i.e. csvUpload.xhtml
>>  http://www.nabble.com/file/p20333785/uploadedCSVDetails.xhtml
>> uploadedCSVDetails.xhtml 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/InputFileUpload-UploadedFile-returns-null-tp4903754p20349023.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Tomahawk & Spring Webflow : enctype="multipart/form-data" doesnt work

Posted by djohnjimmy <dj...@gmail.com>.
Can someone please take a look at this. I am stuck BIG time. Thanks!


djohnjimmy wrote:
> 
> My uploadedFile is null.
> 
> If I put the  <h:form enctype="multipart/form-data"> then the page never
> goes to the next view. If the enctype="plain/text" then it navigation
> works but the uploadedFile is null.
> 
> Environment :
>  Spring WebFlow : 2.0.3.Release
>  Myfaces : 1.2.4
>  Tomahawk : 1.1.6
>  tomahawk-facelets (google project) : 1.1.6.2
>  Websphere AS : 6.1.0.17
>  
> 
> My web.xml
>  http://www.nabble.com/file/p20333785/web.xml web.xml 
> 
> Webflow xml
>  http://www.nabble.com/file/p20333785/upload.xml upload.xml .
> 
> The upload xhtml (I am using facelets and not jsp)
>  http://www.nabble.com/file/p20333785/csvUpload.xhtml csvUpload.xhtml 
> 
> The backend bean :
>  http://www.nabble.com/file/p20333785/UploadCSV.java UploadCSV.java 
> 
> The POJO that I am populating with the CSV values : 
>  http://www.nabble.com/file/p20333785/CSVPractice.java CSVPractice.java 
> 
> The uploaded CSV details in the 2nd Page : // It uses a h:dataTable to
> display the CSV data uploaded in the previous page i.e. csvUpload.xhtml
>  http://www.nabble.com/file/p20333785/uploadedCSVDetails.xhtml
> uploadedCSVDetails.xhtml 
> 
> 

-- 
View this message in context: http://www.nabble.com/InputFileUpload-UploadedFile-returns-null-tp4903754p20343296.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Tomahawk & Spring Webflow : enctype="multipart/form-data" doesnt work

Posted by djohnjimmy <dj...@gmail.com>.
My uploadedFile is null.

If I put the  <h:form enctype="multipart/form-data"> then the page never
goes to the next view. If the enctype="plain/text" then it navigation works
but the uploadedFile is null.

Environment :
 Spring WebFlow : 2.0.3.Release
 Myfaces : 1.2.4
 Tomahawk : 1.1.6
 tomahawk-facelets (google project) : 1.1.6.2
 Websphere AS : 6.1.0.17
 

My web.xml
http://www.nabble.com/file/p20333785/web.xml web.xml 

Webflow xml
http://www.nabble.com/file/p20333785/upload.xml upload.xml .

The upload xhtml (I am using facelets and not jsp)
http://www.nabble.com/file/p20333785/csvUpload.xhtml csvUpload.xhtml 

The backend bean :
http://www.nabble.com/file/p20333785/UploadCSV.java UploadCSV.java 

The POJO that I am populating with the CSV values : 
http://www.nabble.com/file/p20333785/CSVPractice.java CSVPractice.java 

The uploaded CSV details in the 2nd Page : // It uses a h:dataTable to
display the CSV data uploaded in the previous page i.e. csvUpload.xhtml
http://www.nabble.com/file/p20333785/uploadedCSVDetails.xhtml
uploadedCSVDetails.xhtml 

-- 
View this message in context: http://www.nabble.com/InputFileUpload-UploadedFile-returns-null-tp4903754p20333785.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: InputFileUpload/UploadedFile returns null

Posted by pokkie <po...@gmail.com>.
Yes I did, but from what I gather, the problem is that my inputFileUpload
component is declared within a tabbedPane.
--
View this message in context: http://www.nabble.com/InputFileUpload-UploadedFile-returns-null-t1799337.html#a4923896
Sent from the MyFaces - Users forum at Nabble.com.


Re: InputFileUpload/UploadedFile returns null

Posted by Sven Haiges <sv...@googlemail.com>.
Did you try using action instead of actionListener?

Sven

On 6/16/06, pokkie <po...@gmail.com> wrote:
>
>
> Hello all,
>
> For some reason, when my form is submitted, the setter in my backing bean
> that is tied
> to my inputFileUpload component isn't called, and subsequently, any
> attempt
> of
> retrieving a reference is also returned as 'null'
>
> JSP
> -----
> <h:form id="createEmailForm" enctype="multipart/form-data">
>         <f:verbatim>
>             E-Mail Attachment (1) :
>         </f:verbatim>
>         <t:inputFileUpload id="uploadFile1" value="#{emailBean.uploadFile1
> }"
> storage="file" size="30" style="width:305px; background:#f5f5f5;"/>
>
>       <t:commandButton id="updateEmailDetails"
>                        value="Update E-Mail Details"
>                        actionListener="#{emailBean.updateEmailDetails}"
>                        styleClass="submit"
>                        rendered="#{emailBean.emailDetails}"/>
> </h:form>
>
> Backing Bean
> -------------------
> private UploadedFile uploadFile1;
>
> public UploadedFile getUploadFile1() {
>         logger.debug("getter is invoked, upload 1");
>         return uploadFile1;
>     }
>
>     public void setUploadFile1(UploadedFile uploadFile1) {
>         logger.debug("setter is invoked, upload 1");
>         this.uploadFile1 = uploadFile1;
>     }
>
> // Form ActionListener
> public void updateEmailDetails(ActionEvent actionEvent) {
>         logger.debug("file upload is : " + getUploadFile1()); // returns
> null
>     }
>
> web.xml
> ------------
> <filter>
>         <filter-name>MyFacesExtensionsFilter</filter-name>
>
> <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter
> </filter-class>
>         <init-param>
>             <param-name>uploadMaxFileSize</param-name>
>             <param-value>20m</param-value>
>         </init-param>
>         <init-param>
>             <param-name>uploadThresholdSize</param-name>
>             <param-value>100k</param-value>
>         </init-param>
>         <init-param>
>             <param-name>uploadRepositoryPath</param-name>
>             <param-value>/home/behemoth/temp</param-value>
>         </init-param>
>     </filter>
>
> I am using the latest, 16 June 2006, snapshot versions of tomahawk and
> myfaces.
> Originally I was using tomahawk 1.1.2 and a snapshot of myfaces 30 April
> 2006, but
> since the replacement, the problem stays the same. Furthermore, I have
> enabled logging
> on myfaces and the apache packages with level of DEBUG and neither have
> releaved
> any clues as to why this is not working.
>
> Any help would be much appreciated,
>
> -- Pokkie
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/InputFileUpload-UploadedFile-returns-null-t1799337.html#a4903754
> Sent from the MyFaces - Users forum at Nabble.com.
>
>


-- 
Sven Haiges
sven.haiges@googlemail.com

TEL +49 89 420 958 993 | SIPgate 8008878 | Skype: hansamann
Personal Homepage, Wiki & Blog: http://www.svenhaiges.de