HI,
I'm trying to use primefaces 2.1 with jsf 1.2. But when I load my jsp page I just get this javascript error: " 'PrimeFaces' is undefined " and when i am putting p:resources in f:view no error is coming but contents not displayed
Please suggest me what to do to come out this error
this is my jsp code
<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://primefaces.prime.com.tr/ui" prefix="p"%>
<html>
<head>
<p:resources />
</head>
<body>
<f:view>
<h:form>
<p:commandButton></p:commandButton>
</h:form>
</f:view>
</body>
</html>
'PrimeFaces' is undefined error
-
- Posts: 25
- Joined: 30 Aug 2010, 07:56
this is my web.xml code.
<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>
<context-param>
<param-name>com.sun.faces.allowTextChildren</param-name>
<param-value>true</param-value>
</context-param>
<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>
<context-param>
<param-name>com.sun.faces.allowTextChildren</param-name>
<param-value>true</param-value>
</context-param>
-
- Posts: 25
- Joined: 30 Aug 2010, 07:56
Thanks for reply
i changed my application from jsf 1.2 to myfaces 2.0 now i am getting follwing exception while accessing jsp page
org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/sun/faces/taglib/jsf_core/ViewTag
Caused by:
java.lang.NoClassDefFoundError - com/sun/faces/taglib/jsf_core/ViewTag
list of jar files in lib folder
commons-beanutils-1.7.0.jar
commons-codec-1.3.jar
commons-collections-3.2.jar
commons-digester-1.8.jar
commons-discovery-0.4.jar
commons-logging-1.1.1.jar
myfaces-api-2.0.1.jar
myfaces-impl-2.0.1.jar
primefaces-2.1.jar
and 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_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>Test</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<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>
<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-name>
<servlet-class>org.apache.myfaces.webapp.MyFacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>faces</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>faces</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
</web-app>
and my jsp page -
<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://primefaces.prime.com.tr/ui" prefix="p"%>
<html>
<head>
</head>
<body>
<f:view>
<h:form>
<p:panel></p:panel>
</h:form>
</f:view>
</body>
</html>
please suggest me where is going wrong ?
thanks
i changed my application from jsf 1.2 to myfaces 2.0 now i am getting follwing exception while accessing jsp page
org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/sun/faces/taglib/jsf_core/ViewTag
Caused by:
java.lang.NoClassDefFoundError - com/sun/faces/taglib/jsf_core/ViewTag
list of jar files in lib folder
commons-beanutils-1.7.0.jar
commons-codec-1.3.jar
commons-collections-3.2.jar
commons-digester-1.8.jar
commons-discovery-0.4.jar
commons-logging-1.1.1.jar
myfaces-api-2.0.1.jar
myfaces-impl-2.0.1.jar
primefaces-2.1.jar
and 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_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>Test</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<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>
<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-name>
<servlet-class>org.apache.myfaces.webapp.MyFacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>faces</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>faces</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
</web-app>
and my jsp page -
<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://primefaces.prime.com.tr/ui" prefix="p"%>
<html>
<head>
</head>
<body>
<f:view>
<h:form>
<p:panel></p:panel>
</h:form>
</f:view>
</body>
</html>
please suggest me where is going wrong ?
thanks
-
- Posts: 25
- Joined: 30 Aug 2010, 07:56
Hi,
above problem is resolved but still i am getting 'Primefacers' is undefined script error same application is working for facelets but when i am trying in jsp getting error please guide me if any additional setup or jar file required
Thanks
above problem is resolved but still i am getting 'Primefacers' is undefined script error same application is working for facelets but when i am trying in jsp getting error please guide me if any additional setup or jar file required
Thanks
As already stated: don't use JSP with JSF 2.0 as then JSF behaves in a backward compatibility mode and is not using any new features of JSF 2.0. Facelets is the technology to use.
And you HAVE to use <h:head> in JSF 2.0 as jsf needs it for the ressources!
And you HAVE to use <h:head> in JSF 2.0 as jsf needs it for the ressources!
-
- Posts: 25
- Joined: 30 Aug 2010, 07:56
Hi,
Thanks for your suggestion and quick reply we want to use primefaces in our product and we have jsp files its very hard to convert all jsp files to Facelets (.xhtml) so there is no way to use primefaces in jsp ?
Thanks
Thanks for your suggestion and quick reply we want to use primefaces in our product and we have jsp files its very hard to convert all jsp files to Facelets (.xhtml) so there is no way to use primefaces in jsp ?
Thanks
you can safely use JSF 1.2 with Primefaces 1.1 if you have no problem that both frameworks don't update anymore and you'll get no new features anymore. Don't know for sure about bugfixes, but no new features.
In JSF 2.0 with PF you can use JSP's only as a backward compatibility as facelets is the only and official technology to define JSF views.
In JSF 2.0 with PF you can use JSP's only as a backward compatibility as facelets is the only and official technology to define JSF views.
-
- Information
-
Who is online
Users browsing this forum: Google [Bot] and 31 guests