Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7992699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:38:29+00:00 2026-06-04T13:38:29+00:00

I am using myfaces ExtensionFilter to upload a file, but the file is not

  • 0

I am using myfaces ExtensionFilter to upload a file, but the file is not getting set to my bean for further processing.

Here is the code :

<h:form id="uploadFileForm" enctype="multipart/form-data">
    <tom:inputFileUpload id="file" 
        value="#{paramUpload.uploadFile}">
        <f:valueChangeListener type="com.bosch.de.plcd.plugin.ParamFileUpload" />
    </tom:inputFileUpload>
    <a4j:commandButton value="#{tpMsgs.upload}"
        styleClass="button" action="#{paramUpload.uploadParamFile}"
        onclick="javascript:updateParentScreen();">
    </a4j:commandButton>
</h:form>

and web.xml configuration is as below

<filter>
    <filter-name>Extensions Filter</filter-name>
    <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>Extensions Filter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
</filter-mapping>

Since UploadFile was not set to bean, I also tried using ValueChangeListener, never the less, its not se to bean 🙂

Bean code

public class ParamFileUpload implements ValueChangeListener {

    private UploadedFile uploadFile;

    public void uploadParamFile() {
        if(uploadFile != null) {
            LOGGER.info("File type: " + uploadFile.getContentType());
            LOGGER.info("File name: " + uploadFile.getName());
            LOGGER.info("File size: " + uploadFile.getSize() + " bytes");
        }
    }

    public UploadedFile getUploadFile() {
        return uploadFile;
    }

    public void setUploadFile(UploadedFile uploadFile) {
        this.uploadFile = (UploadedFile)uploadFile;
    }

    public void processValueChange(ValueChangeEvent event)
        throws AbortProcessingException {
        this.uploadFile = (UploadedFile) event.getNewValue();
    }
}

Do you see any other configuration that I might be missing here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:38:31+00:00Added an answer on June 4, 2026 at 1:38 pm

    It is not possible to upload files by ajax with current JSF and Tomahawk version. Ajax requests as created by JSF do not support nor use multipart/form-data. Tomahawk is not an ajax based component library. Use a normal command button instead.

    <h:commandButton value="#{tpMsgs.upload}"
        styleClass="button" action="#{paramUpload.uploadParamFile}"
        onclick="javascript:updateParentScreen();">
    </h:commandButton>
    

    Support for uploading files with ajax is scheduled for upcoming JSF 2.2 with new <h:inputFile> component.

    Alternatively, you can use RichFaces’ own <rich:fileUpload>. Depending on the RichFaces version used, it uses either Flash or an iframe hack under the covers to achieve asynchronous file uploading.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Actually I'm creating an application for uploading file using JSF. But whenever I upload
I'm using Tomahawk library for the file upload. However, the backing bean's method is
I have developed web applications using JSF (myfaces components). But in these days of
I'm facing some problems using CDATA blocks inside h:outputscripts with MyFaces 2.0... but I
I'm embedding here a simplified version of a code that is not working for
I'm using MyFaces 1.1.7 with Facelets and Tomahawk. When creating a regular data table,
I am working with MyFaces/Primefaces and I have a problem to get information using
I'm using JBoss6.1.Final, JSF 2.0 (Mojarra), Weld CDI, MyFaces CODI 1.0.5 (for view-access-scoped) I'm
Using PyGtk's IconView, I can set the icons to be reorderable by calling gtk.IconView.set_reorderable(True)
Using Java,I have to fetch multiple sets of values from an XML file to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.