PrimeFaces chips does not add items [duplicate] - jsf

This question already has answers here:
Submitting a form by pressing enter without a submit button
(20 answers)
Closed 1 year ago.
After deploy this code i go to browser and put some data in input field and press enter. It should add text to chips but it doesn't i don't have idea why plaease help.
xhtml code
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>Chips</title>
</h:head>
<h:body>
Chips
<br/>
<h:form>
<h:panelGrid columns="2">
<p:outputLabel value="Add Color"/>
<p:chips />
<p:outputLabel for="display" value="Avaiable Colors"/>
<p:chips id="display" value="#{colors.colors}"/>
</h:panelGrid>
</h:form>
</h:body>
</html>
I use this java class for xhtml with use JSF and PrimeFaces.
#ViewScoped
#Data
#Named
public class Colors implements Serializable{
private List<String> colors;
#PostConstruct
public void init() {
colors = new ArrayList<>();
colors.add("Red");
colors.add("Blue");
colors.add("Green");
colors.add("Yellow");
colors.add("Orange");
colors.add("Purple");
}
}
This is my pom.xml file maybe here something is missing. Please help it's look everything fine.
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>pl.mz</groupId>
<artifactId>Primefaces-YtTutorial</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<failOnMissingWebXml>false</failOnMissingWebXml>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<jakarta.jakartaee-api.version>8.0.0</jakarta.jakartaee-api.version>
<microprofile.version>3.0</microprofile.version>
<mockito-core.version>3.1.0</mockito-core.version>
<junit-jupiter.version>5.5.0</junit-jupiter.version>
</properties>
<dependencies>
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>${jakarta.jakartaee-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>${microprofile.version}</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>11.0.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito-core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
</dependencies>
<build>
<finalName>Primefaces-YtTutorial</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
</plugins>
</build>
</project>

I add not visible commandButton and this start work corectly. But i hope someone will show me beter why to solve this issue or will point some bug in my code. I leave my solution here.
<h:form>
<h:panelGrid columns="2">
<p:outputLabel value="Add Color"/>
<p:chips/>
<p:outputLabel for="display" value="Avaiable Colors"/>
<p:chips id="display" value="#{colors.colors}"/>
</h:panelGrid>
<p:commandButton rendered="false"/>
</h:form>

Related

InputText in form for JSF 2.3.1

I would like to have a input text field for a form in JSF 2.3.1 (with J2E) but I have nothing on my page, only the text H1 ...
I searched on other posts, they said because the alias should be com.sun but I don't know how to change it :(
Every comments are welcomed :)
Edit: I can't see h:commandButton neither
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>First Project JSF 2.3</title>
</h:head>
<h:body>
<h1>First Project JSF 2.3 - hello.xhtml</h1>
<h:form>
<h:inputText value="#{helloBean.name}" />
</h:form>
</h:body>
</html>
The pom.xml file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.primagaz</groupId>
<artifactId>ProjectTest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<!-- Servlet provided by tomcat -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<!-- JSF -->
<!-- https://mvnrepository.com/artifact/org.apache.myfaces.core/myfaces-api -->
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
<version>2.3.1</version>
</dependency>
<!-- PrimeFaces -->
<!-- https://mvnrepository.com/artifact/org.primefaces/primefaces -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>6.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jboss.weld.servlet/weld-servlet-core -->
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet-core</artifactId>
<version>3.0.4.Final</version>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

p:spinner not shown

I work with PrimeFaces 5.2.
These are my maven dependencies:
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.2</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1.7</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.1.7</version>
</dependency>
</dependencies>
I have the XHTML:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:p="http://primefaces.org/ui">
<f:view contentType="text/html">
<h:head />
<h:body>
<h:outputLabel>Name:</h:outputLabel>
<h:form>
<p:spinner />
</h:form>
</h:body>
</f:view>
</html>
The output screen is
How do I have to configure my project to see the spinner?
I think you should read the documentation for a spinner in Primefaces. Spinner is primarily used to increment/decrement the value of input text. You also need to create a bean defining the setter/getter for the values.
Do have a look https://www.primefaces.org/showcase/ui/input/spinner.xhtml
Just for reference:
<h:outputLabel for="basic" value="Basic Spinner: " />
<p:spinner id="basic" value="#{spinnerView.number1}" />
Hope it helps!!

Primefaces FileUpload not working in Spring Boot

I'm running my JSF project launching it with Spring Boot and taking advantage of the whole Spring environment. The configuration is: Mojarra 2.2.8 + Primefaces 5.1 + Spring Boot 1.1.9. That's how my POM.xml file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.1.9.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>${jsf.version}</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>${jsf.version}</version>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.1</version>
</dependency>
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>all-themes</artifactId>
<version>1.0.10</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>el-impl</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<start-class>com.tesicnor.workplace.monitor.Application</start-class>
<java.version>1.7</java.version>
<tomcat.version>7.0.57</tomcat.version>
<jsf.version>2.2.8</jsf.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
As it's specified above, I'm configuring the project to run in a tomcat 7.0.57 (Servlet 3.0 compatible) launcher. All the JSF functions are properly working, but the problem is I can't get the Primefaces p:fileUpload component work, neither the basic or the advanced versions. The file upload listener doesn't get invoked and no error thrown.
That's my bean's code:
#ManagedBean
#javax.faces.bean.ViewScoped
public class Bean {
public void handleFileUpload(FileUploadEvent event) {
FacesMessage message = new FacesMessage("Succesful", event.getFile()
.getFileName() + " is uploaded.");
FacesContext.getCurrentInstance().addMessage(null, message);
System.out.println("Uploaded!");
}
}
And that's how my xhtml file looks like, under a template:
<ui:composition template="/WEB-INF/template.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<ui:define name="content">
<h:form>
<p:fileUpload fileUploadListener="#{bean.handleFileUpload}" />
</h:form>
</ui:define>
</ui:composition>
Nothing special about the code at all, it must be a server configuration issue. When I drop the file and click on upload, the FacesServlet gets hit. So the request is performed and no javascript errors shown. But when I perform a debugging into the InvokeApplicationPhase class, where my method should be invoked, I find no events to be processed. So the FileUploadEvent is not being attached to the cycle.
Furthermore, that's the debugging stack of another project that properly performs the file upload with Tomcat 7 and that JSF version:
Here the NativeFileUploadDecoder is being called. However that's not happening in my Spring boot project and no method below FileUpload#visitTree is invoked.
I tried other choices and found out that when I use some <h:form enctype="multipart/form-data"> none of the action methods for components inside are invoked, even when I place a plain h:commandButton.
Finally, I got it working using the Apache Commons library. Similarly that what we might do in a standard web.xml file, that's my context initializer:
#Bean
public ServletContextInitializer initializer() {
return new ServletContextInitializer() {
#Override
public void onStartup(ServletContext servletContext)
throws ServletException {
servletContext.setInitParameter("primefaces.THEME", "bluesky");
servletContext.setInitParameter(
"javax.faces.FACELETS_SKIP_COMMENTS", "true");
servletContext.setInitParameter(
"com.sun.faces.expressionFactory",
"com.sun.el.ExpressionFactoryImpl");
servletContext.setInitParameter("primefaces.UPLOADER",
"commons");
}
};
}
I explicitly tell Primefaces to use the commons uploader, like said in docs (the other choice is to use native, which is not working).
Then, just adding this two dependencies to the project, we're ready to go:
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.2</version>
</dependency>
I keep the thread opened for some response based in the native mode.
See also:
How to use PrimeFaces p:fileUpload? Listener method is never invoked or UploadedFile is null
It could be also necessary to transfer xml filter configuration to Java-based Config :
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
to your #Configuration
#Bean
public FilterRegistrationBean FileUploadFilter() {
FilterRegistrationBean registration = new FilterRegistrationBean();
registration.setFilter(new org.primefaces.webapp.filter.FileUploadFilter());
registration.setName("PrimeFaces FileUpload Filter");
return registration;
}
in combination with the above answer it work for me
Just to put my two cents, with Spring boot 1.4.2.RELEASE, Primefaces 6.0, OCP Soft rewrite 2.0.12.Final, JSF 2.1.29-08 and application deployed on Tomcat 8, I also need to disable spring hiddenHttpMethodFilter.
#Bean
public FilterRegistrationBean hiddenHttpMethodFilterDisabled(
#Qualifier("hiddenHttpMethodFilter") HiddenHttpMethodFilter filter) {
FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(filter);
filterRegistrationBean.setEnabled(false);
return filterRegistrationBean;
}
I have spent with this issue almost two days and as last thing I have tried to disable spring filters one by one, so I hope it will help someone.

After deployment at OpenShift, opening JSF page ends up in "The XML file does not appear to have any style information associated with it" error

I made basic web service with two pages. I used primefaces lib and jsf. On my locallhost (jboss 6.x) the webpage works correctly. If I deployed it to openshift It looks like on the screenshot:
Here is my pom.xml:
``
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>aj</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>aj</name>
<repositories>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
<repository>
<id>central</id>
<name>Maven Repository Switchboard</name>
<layout>default</layout>
<url>http://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<properties>
<!-- Explicitly declaring the source encoding eliminates the following message: -->
<!-- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Define the version of JBoss' Java EE 6 APIs and Tools we want to import. -->
<javaee6.with.tools.version>1.0.0.M1</javaee6.with.tools.version>
<!-- Alternatively, comment out the above line, and un-comment the line below to use version 3.0.0.Beta1-redhat-1
which is a release certified to work with JBoss EAP 6. It requires you have access to the JBoss EAP 6 maven repository. -->
<!-- <javaee6.spec.version>3.0.0.Beta1-redhat-1</javaee6.spec.version> -->
</properties>
<dependencyManagement>
<dependencies>
<!-- JBoss distributes a complete set of Java EE 6 APIs including a Bill of Materials (BOM). A BOM specifies
the versions of a "stack" (or a collection) of artifacts. We use this here so that we always get the correct versions of
artifacts. Here we use the jboss-javaee-6.0-with tools stack (you can read this as the JBoss stack of the Java EE 6 APIs,
with some extras tools for your project, such as Arquillian for testing) -->
<dependency>
<groupId>org.jboss.bom</groupId>
<artifactId>jboss-javaee-6.0-with-tools</artifactId>
<version>${javaee6.with.tools.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>3.5</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<compilerArguments>
<endorseddirs>${basedir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${basedir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>6.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Has anyone got the same problem? Thanks a lot for help.
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<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>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
index.xhtml:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
<p:layout fullPage="true">
<p:layoutUnit position="north" size="100" resizable="true" closable="true" collapsible="true">
Header
</p:layoutUnit>
<p:layoutUnit position="south" size="100" closable="true" collapsible="true">
Footer
</p:layoutUnit>
<p:layoutUnit position="west" size="250" collapsible="true">
<h:form>
<p:menu>
<p:submenu >
<p:menuitem value="home" action="#{menuBean.home()}" />
<p:menuitem value="wynik" action="#{menuBean.wynik()}" />
</p:submenu>
</p:menu>
</h:form>
</p:layoutUnit>
<p:layoutUnit position="center">
Welcome to PrimeFaces
</p:layoutUnit>
</p:layout>
<br />
<h:link outcome="welcomePrimefaces" value="Primefaces welcome page" />
<br />
<h:link outcome="welcomePrimefaces" value="Primefaces welcome page" />
</h:body>
</html>
You're attempting to access the index.xhtml. However, your faces servlet mapping indicates that it should be /context-root/faces/index.xhtml
Also note that open shift is based on JBoss AS 7, not JBoss AS 6. If you want to verify that your application will work locally you should switch to AS7.

Warning: This page calls for XML namespace http://primefaces.prime.com.tr/ui declared with prefix p but no taglibrary exists for that namespace

I'm trying to start with Primefaces 2.2.1, but I can't. I have the following definition in pom.xml:
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>2.2.1</version>
</dependency>
But I recevie the following error message:
Warning: This page calls for XML namespace http://primefaces.prime.com.tr/ui declared with prefix p but no taglibrary exists for that namespace.
with this simple code:
<?xml version='1.0' encoding='UTF-8' ?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
Hello from Facelets
<p:editor />
</h:body>
</html>
Include the tag lib as :
xmlns:p="http://primefaces.org/ui"
And the dependency in pom.xml as :
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>3.0.M4</version>
</dependency>
I was also facing the same issue. This solution fixed my problem.
You should have the <repository> between <repositories> :
Try this:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>jsf_primefaces</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>jsf_primefaces</name>
<description>JSF PrimeFaces</description>
<packaging>war</packaging>
<repositories>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>2.2.1</version>
</dependency>
......other dependencies.........
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>2.2</version>
</dependency>
......other dependencies.........
</dependencies>
</project>
If you have been using Eclipse's Export WAR function, you need to explicitly add the dependency into the WAR assembly.
Your answer is here: Eclipse exporting JAR in WAR
For me, this was the solution, change the old tag and instead use the following:
xmlns:p="http://primefaces.org/ui"
Their servers must be down right now because I cannot navigate to their forums either.
They are located in Turkey, I believe so they usually go down for nightly maintenance about this time.
Try use xmlns:p="http://primefaces.org/ui"

Resources