简体   繁体   中英

FileUpload not supported with primefaces 5.1 or higher

I have very strange issue. I use FileUpload via prime face and it works perfectly. I use primefaces 5.0. Now I wanted to upgrade to primefaces 6.0, I got error in the following:

import org.primefaces.event.FileUploadEvent;
import org.primefaces.model.UploadedFile;

It says: Package org.primefaces.event.FileUploadEvent doesn't exist

I use Maven:

<repository>
     <id>prime-repo</id>
     <name>Prime Repo</name>
     <url>http://repository.primefaces.org</url>
</repository>

<dependency>
     <groupId>org.primefaces</groupId>
     <artifactId>primefaces</artifactId>
     <version>6.0</version>
</dependency>

I got the same error if I use version higher than 5 (5.1, 5.2,...)

It is strange but I have no idea why.

I dont know if you got this fixed - but i suspect the problem is that primefaces 6.0 is not in your repository -

<repository>
 <id>prime-repo</id>
 <name>Prime Repo</name>
 <url>http://repository.primefaces.org</url>
</repository>

You should remove the above as primefaces recommend it for older versions of PF -

PrimeFaces 4.0 and newer are available at Maven Central, for older releases and RC releases add the following repository definition to your pom.xml in repositories section.

The maven default will now be the central repository which contains 6.0 -

Apache Maven retrieves all components from the Central Repository by default. Starting with Maven 3.2.3 the default access is via HTTPS and no further configuration is required.

http://search.maven.org/#artifactdetails%7Corg.primefaces%7Cprimefaces%7C6.0%7Cjar

Ref -

http://www.primefaces.org/downloads

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM