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 6550135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:10:47+00:00 2026-05-25T12:10:47+00:00

In my application running on Apache Tomcat 6 I use fileUpload from PrimeFaces 3.0.M3.

  • 0

In my application running on Apache Tomcat 6 I use fileUpload from PrimeFaces 3.0.M3. But it don’t works correctly. When I upload files its appears in upload directory, but event not fired. Can somebody help me?

My view code:

<h:form prependId="false" id="uploadForm" enctype="multipart/form-data">
    <p:fileUpload id="uploadControl" fileUploadListener="#{fileUploadBean.uploadHandler}" mode="advanced" />
</h:form>

FileUploadBean class source:

@ManagedBean
@RequestScoped
public class FileUploadBean implements Serializable {

    private static final Logger logger = Logger.getLogger(FileUploadBean.class);

    private UploadedFile file;

    public void uploadHandler(FileUploadEvent event) throws AbortProcessingException {
        logger.debug("uploadHandler(FileUploadEvent event)");
        logger.debug("Uploaded file: " + event.getFile().getFileName());
    }

    public UploadedFile getFile() {
        return file;
    }

    public void setFile(UploadedFile file) {
        this.file = file;
    }
}

My web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.SKIP_COMMENTS</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>primefaces.THEME</param-name>
        <param-value>casablanca</param-value>
    </context-param>
    <filter>
        <filter-name>PrimeFaces FileUpload Filter</filter-name>
        <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
        <init-param>
            <param-name>uploadDirectory</param-name>
            <param-value>/tmp</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>PrimeFaces FileUpload Filter</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    <filter-mapping>
        <filter-name>PrimeFaces FileUpload Filter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <servlet>
        <servlet-name>Resource Servlet</servlet-name>
        <servlet-class>org.primefaces.resource.ResourceServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Resource Servlet</servlet-name>
        <url-pattern>/primefaces_resource/*</url-pattern>
    </servlet-mapping>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.jsf</welcome-file>
    </welcome-file-list>
    <login-config>
        <auth-method>BASIC</auth-method>
    </login-config>

    <servlet>
        <servlet-name>StartupServlet</servlet-name>
        <servlet-class>com.greytower.servlets.StartupServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <listener>
        <listener-class>com.project.servlets.ContextListener</listener-class>
    </listener>

    <servlet>
        <servlet-name>LoginServlet</servlet-name>
        <servlet-class>com.project.servlets.LoginServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>LoginServlet</servlet-name>
        <url-pattern>/login</url-pattern>
    </servlet-mapping>

    <servlet>
        <servlet-name>AjaxServlet</servlet-name>
        <servlet-class>com.project.servlets.AjaxServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>AjaxServlet</servlet-name>
        <url-pattern>/ajax</url-pattern>
    </servlet-mapping>
    <servlet>
        <servlet-name>DownloadServlet</servlet-name>
        <servlet-class>com.project.servlets.DownloadServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>DownloadServlet</servlet-name>
        <url-pattern>/get</url-pattern>
    </servlet-mapping>

    <servlet>
        <servlet-name>ImageServlet</servlet-name>
        <servlet-class>com.project.servlets.ImageServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>ImageServlet</servlet-name>
        <url-pattern>/image</url-pattern>
    </servlet-mapping>
</web-app>
  • 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-05-25T12:10:47+00:00Added an answer on May 25, 2026 at 12:10 pm

    I think your problem is in your web.xml configuration, you have two different filter mappings declared for the File Upload filter, one of them is incorrect:

    <filter-mapping>
       <filter-name>PrimeFaces FileUpload Filter</filter-name>
       <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    <filter-mapping>
       <filter-name>PrimeFaces FileUpload Filter</filter-name>
       <url-pattern>/*</url-pattern>
    </filter-mapping>
    

    Instead you need just this:

     <filter-mapping>
       <filter-name>PrimeFaces FileUpload Filter</filter-name>
       <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    

    You only want to map the file upload filter to the Faces Servlet.

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

Sidebar

Related Questions

We have a application running on Apache Tomcat. When the application is accessed from
I'm doing a performance study for a web application framework running on Apache Tomcat
I have an application running in tomcat that has a bunch of configuration files
I have been tasked to replace the hardware an existing Apache/Tomcat/MySQL application is running.
Scenario: Apache Wicket based web application running on Tomcat server. User opens URL in
I develop Flex-Java applications which is running under Apache Tomcat. I use Flex Builder
I am running a multi-threaded Java web application on Apache Tomcat 6. Instead of
I am trying to get my ZEND application up on my apache server running
I am running a web application using Tomcat and Java Servlets, JSP's, etc. I
We're running a small web application written JRuby on Rails running under Tomcat. We're

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.