I am getting a warning in web.xml file of my JSF project tah uses PrimeFaces library.
Attribute filter-name references to PrimeFacesFileUploadFilter that is not a filter
It seems that code is ok:
<filter>
<filter-name>PrimeFacesFileUploadFilter</filter-name>
<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>PrimeFacesFileUploadFilter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
Code works ok, but can I get rid of this warning somehow?
This warning is not coming from JSF, nor PrimeFaces, nor Servlet filters. It’s coming from the IDE or one of its plugins. Googling on the exact warning message leads us (among your own question) to JBoss Tools issue 10579. It’s caused by bad validation (it’s expecting some element before the
<filter-name>as well) and it’s fixed in 3.3.0.Beta1.So with the newest stable version of 3.3.0 you should not get this warning anymore. In the meanwhile you could workaround this by placing for example a
<description>before the<filter-name>.