I am try to setup JSF project with prime faces library
When I run this setup it shows be following error
org.apache.jasper.JasperException: javax.servlet.ServletException: null source
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:54
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
I did not able to find out reason behind it . following is by setup
Folloing are the library I included into web-inf/lib
1. jsf-api-2.0.3.jar
2. jsf-impl-2.0.3.jar
3. jstl-1.0.2.jar
4. primefaces-3.4.jar
Following are the entrires into web.xml file
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 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_2_5.xsd">
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>primefaces.skin</param-name>
<param-value>none</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>*.jsf</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<listener>
<listener-class>
com.nsf.ecap.web.base.ECapStartUpServlet
</listener-class>
</listener>
</web-app>
login.xhtml
<h:body>
<CENTER>
<h:panel header="Login Form">
<h:Form>
<h:PanelGrid columns="2" cellpadding="2">
<h:outputLabel value="UserName" for="#{loginBBean.userInfo.username}"> </h:outputLabel>
<h:inputText value="#{loginBBean.userInfo.username}" label="UserName"> </h:inputText>
<h:outputLabel value="Password" for="#{loginBBean.userInfo.password}"></h:outputLabel>
<h:inputSecret value="#{loginBBean.userInfo.password}"></h:inputSecret>
<h:commandButton value="Login" type="submit" action="#{loginBBean.doLogin}"></h:commandButton>
</h:PanelGrid>
<h:messages>
</h:messages>
</h:Form>
</h:panel>
</CENTER>
</h:body>
</html>
index.jsp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<jsp:forward page="jsp/login/login.jsf"/>
</body>
</html>
"My JSP 'index.jsp' starting page"? Please block/ignore/throwaway that tutorial you're reading now. It's only completely confusing you and teaching you bad practices.
As to your list of libraries:
Folloing are the library I included into web-inf/lib
jsf-api-2.0.3.jar
jsf-impl-2.0.3.jar
jstl-1.0.2.jar
primefaces-3.4.jar
First of all, the JSTL version is wrong. It should be at least JSTL 1.1 or preferably 1.2. The EL (expression language, those ${}/#{}) things would otherwise fail to work. Remove jstl-1.0.2.jar and put jstl-1.2.jar in place.
Further it looks okay. It only surprises me that you've more than 2 years old JSF API/impl versions while you've a fairly recent (less than 2 weeks) PrimeFaces version. I'd align those JSF API/impl versions as well to be the latest available. It's currently already at 2.1.13 (note: it's now composed of only one JAR file javax.faces.jar instead of two JAR files).
As to your web.xml:
<web-app version="2.5" 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_2_5.xsd">
This is declared conform Servlet 2.5 spec which is over 6 years old already. Are you sure that you're running such an outdated container? Given the presence of the JSF and JSTL libraries, I assume that you're using Tomcat. The current Tomcat version, 7.x, exist more than 2 years already and is Servlet 3.0 compatible. You should declare your web.xml to match the highest supported version of the target container.
<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">
Further, those javax.faces.STATE_SAVING_METHOD and javax.faces.DEFAULT_SUFFIX entries represent the default values already. Just get rid of them to minimize noise.
As to your login.xhtml:
<h:Form>
<h:PanelGrid columns="2" cellpadding="2">
Tag names are case sensitive. The <h:Form> and <h:PanelGrid> doesn't exist at all. It are <h:form> and <h:panelGrid>.
<CENTER>
While not immediately a problem, but this HTML element is deprecated since 1998 in favor of CSS. Also, seeing it in uppercased flavor instead of <center>, which is very typical for pre-90's HTML style, doesn't give me the impression that you're reading the most recent and right books/tutorials to learn web development. You should assure that your learning resources are up to date.
As to your index.jsp: this is completely useless. Remove it altogether. Just change your web.xml from
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
to
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>login.xhtml</welcome-file>
</welcome-file-list>
and this way login.xhtml will show up as "home page" when you access / in your webbrowser. Note that you shouldn't and don't need *.jsf URL pattern anymore.
See also:
Our JSF wiki page - at the bottom you can find decent JSF 2.0 resources
Related
I am trying to create a RichFaces application and because of some reasons I am using quite old versions i.e. I have to work with JSF 1.2 and RichFaces 3.0.1.
I have got the JSF 1.2 components working but when I am trying to create a simple page with a RichFaces component then component is getting render but it is broken. Below is actual and expected look and feel:
Expected (this from here, code is also present over there, just scroll little below over there, my code is coming below):
Actual:
I am getting menu options correctly but missing all those blue stuff and look-and-feel.
It looked to me that some CSS or images are missing, but I am using the RichFaces JAR and there is no mention in the tutorial that additional images/css would be required so I am ruling out this.
Then I thought that it could be container issue, I checked RichFaces technical requirements and for Apache Tomcat it should not be greater than 6.0 (Apache Tomcat 5.5 - 6.0), and I was working on 7.x, so I jumped that bingo I found the issue, but alas that I got same issue even when I deployed in Tomcat 5.5.
As per best of my knowledge I am having correct configuration details and all required JARs, but considering the situation I am having feeling that I am missing some configuration or something else.
richfaces_test_so.jsp:
<%#taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%#taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%#taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>
<html>
<head>
<title>Add New User Form</title>
</head>
<body>
<f:view>
<h:form>
<rich:dropDownMenu value="File" direction="bottom-right" jointPoint="bl">
<rich:menuItem submitMode="ajax" value="New" action="#{helloBean.addUser}"/>
<rich:menuItem submitMode="ajax" value="Open" action="#{helloBean.addUser}"/>
<rich:menuGroup value="Save As...">
<rich:menuItem submitMode="ajax" value="Text File" action="#{helloBean.addUser}"/>
<rich:menuItem submitMode="ajax" value="PDF File" action="#{helloBean.addUser}"/>
</rich:menuGroup>
<rich:menuItem submitMode="ajax" value="Close" action="#{helloBean.addUser}"/>
<rich:menuSeparator id="menuSeparator11"/>
<rich:menuItem submitMode="ajax" value="Exit" action="#{helloBean.addUser}"/>
</rich:dropDownMenu>
</h:form>
</f:view>
</body>
</html>
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>jsftest_tomcat_5</display-name>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<!-- Ajax4JSF -->
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>blueSky</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING</param-name>
<param-value>enable</param-value>
</context-param>
<filter>
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>ajax4jsf</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-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>
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>greeting.xhtml</welcome-file>
</welcome-file-list>
</web-app>
List of my JARs:
ajax4jsf-1.1.1.jar
commons-beanutils-1.7.0.jar
commons-codec-1.3.jar
commons-collections-3.1.jar
commons-dbcp-1.2.2.jar
commons-digester-1.6.jar
commons-el-1.0.jar
commons-fileupload-1.2.2.jar
commons-io-1.3.2.jar
commons-lang-2.1.jar
commons-logging-1.0.4.jar
commons-pool-1.3.jar
el-ri-1.0.jar
javax.el-api-2.2.4.jar
jsf-facelets-1.1.11.jar
jstl-1.1.0.jar
myfaces-api-1.1.5.jar
myfaces-impl-1.1.5.jar
richfaces-3.0.1.jar
tomahawk-1.1.6.jar
Could someone please help me point out if I am missing something. I have to work on RichFaces 3.0.1 and JSF 1.2, so please do not advise to work on latest versions.
I have a simple JSF page displaying a text editor from primefaces (Showcase).
However, the text editor is not displayed. When I inspect it (F12 in chrome), I see multiple errors, the first one is:
core.js.xhtml:2 Uncaught ReferenceError: $ is not defined
at Object.resolveUserAgent (core.js.xhtml:2)
at Object.init (core.js.xhtml:2)
at core.js.xhtml:2
The others are Uncaught TypeError: Cannot read property 'Tag from Primefaces' of undefined.
I read those questions: 1 / 2, but I do have a <h:head>.
What am I missing?
My page (index.xhtml):
<h:html xmlns="http://www.w3.org/1999/xhtml"
xmlns:b="http://bootsfaces.net/ui"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<h:outputStylesheet library="css" name="style.css" />
<h:outputScript library="js" name="script.js" />
</h:head>
<h:body>
<p:textEditor value="#{textEditorController.text}" height="300" style="margin-bottom:10px"/>
<p:commandButton value="Submit" action="#{textEditorController.submit}"/>
</h:body>
</h:html>
My web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1">
<display-name>MusiglabelWEB</display-name>
<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>*.xhtml</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>facelets.SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
</web-app>
I use muliple projects (WEB, JPA, EJB, EAR), if that matters.
Included Libraries in WEB Project:
Primefaces 6.1 (Downloaded here)
Bootsfaces 1.1.1 (Downloaded here)
This is a bug in PrimeFaces, I registered it here. It manifests when a p:textEditor is the first of PrimeFaces components in the final view.
To work around the bug simply add some other component before it, you can make it not rendered, so it won't affect your page otherwise:
<p:inputText rendered="false" />
<p:textEditor />
I got the same problem.
solved with importing both jquery and jquery ui like following
...
<h:head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
</h:head>
...
Here how look my .jspx files:
<?xml version='1.0' encoding='utf-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html" xmlns:c="http://java.sun.com/jsp/jstl/core">
<jsp:output omit-xml-declaration="true" doctype-root-element="HTML" doctype-system="http://www.w3.org/TR/html5"/>
<jsp:directive.page contentType="text/html;charset=utf-8"/>
<f:loadBundle basename="my.pack.resource" var="r"/>
<f:loadBundle basename="my.pack.error" var="e"/>
<f:view>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html utf-8"/>
<meta name="viewport" content="width=device-width"/>
<title> Some title </title>
<jsp:directive.include file="/temp/myLayout.jspf" />
</head>
<body>
<h:form>
<h:commandLink .........
</h:form>
</body>
</html>
</f:view>
</jsp:root>
In order to keep my view files clear and small
I would like to put all above and after body in
templates and include it in my .ispx files and pass title as parameter.
If anybody knows solution, please help.
EDIT
I have changed my view from .jspx to .xhtml, but my servlet filters now don't work.
Here my web.xml:
<?xml version = '1.0' encoding = 'windows-1252'?>
<web-app 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_2_5.xsd"
version="2.5">
<context-param>
<param-name>javax.faces.FACELETS_VIEW_MAPPINGS</param-name>
<param-value>*.xhtml;*.jsf</param-value>
</context-param>
<filter>
<filter-name>loginFilter</filter-name>
<filter-class>my.pack.filterpack.LoginFilter</filter-class>
</filter>
<filter>
<filter-name>remebermefilter</filter-name>
<filter-class>my.pack.filterpack.RemeberMeFilter</filter-class>
</filter>
<filter>
<filter-name>NoCacheFilter</filter-name>
<filter-class>my.pack.filterpack.NoCacheFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>loginFilter</filter-name>
<url-pattern>/view/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>remebermefilter</filter-name>
<url-pattern>/login/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>NoCacheFilter</filter-name>
<url-pattern>*.xhtml</url-pattern>
<dispatcher>FORWARD</dispatcher>
</filter-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 mappings -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<error-page>
<error-code>500</error-code>
<location>/index.jsp</location>
</error-page>
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>/viewExp.jsp</location>
</error-page>
<listener>
<listener-class>my.pack.timer.MyJobManager</listener-class>
</listener>
</web-app>
This is one of the reasons why JSP(X) is abandoned, deprecated and succeeded by Facelets 4 years ago. JSP(X) doesn't offer easy templating capabilities in order to achieve this kind of requirements.
Just migrate to Facelets. Rename .jspx to .xhtml and replace <jsp:xxx> tags by <ui:xxx> tags. Your functional requirement is answered in 2nd example of How to include another XHTML in XHTML using JSF 2.0 Facelets?
Facelets is natively available in JSF 2.x. If you're still using JSF 1.x, then you can just install it separately as per its documentation.
I wrote a simple jsf web app on eclipse. My web app works fine when I run it on tomcat 7 server in eclipse. Now I am in the process of deploying it to a server host name = cheetah.arvixe.com.
to do this I have exported my web app as a war file and have unzipped this war file in the public_html folder of the arvixe server.
When I go to my website on my browswer, i get a blank page. When I look at the page source I see my index.xhtml with the jsf tags. I want to know why my page is not showing. Any ideas?
Here is my index.html code:
<!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">
<ui:composition template="/WEB-INF/templates/BasicTemplate.xhtml">
<ui:define name="content">
<h:form>
<h:panelGrid columns="2">
<h:outputText value="Name"></h:outputText>
<h:inputText id="userid" value="#{user2.userId }"></h:inputText>
<h:outputText value="Password"></h:outputText>
<h:inputSecret id="password" value="#{user2.pincode}"
required="true" requiredMessage= "#{vm['loginBean.password']}">
<h:messages for="password" style="color:red" />
</h:inputSecret>
</h:panelGrid>
<h:commandButton value="Register" action="query_results"></h:commandButton>
</h:form>
</ui:define>
</ui:composition>
</html>
and here is my web.xml code:
<?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>Redlancelogin</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.xhtml</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</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>*.xhtml</url-pattern>
</servlet-mapping>
<context-param>
<description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
</web-app>
in my web-ing/lib i have the jsf-api.jar and jsf-imp.jar
please tell me why I keep getting a blank page when i deploy to the host server. Thank you in advance!!!!
Hi Friends JSF primefaces charts not display i am using following .jar files in my application
1)primefaces-3.0.M1.jar
2)jstl-1.0.2.jar
3)jsf-impl.jar
4)jsf-api.jar
but i am getting below exception
org.apache.jasper.JasperException: /pieChartLive.jsp(16,34) #{..} is not allowed in template text
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:102)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:711)
org.apache.jasper.compiler.Node$ELExpression.accept(Node.java:935)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2392)
org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
org.apache.jasper.compiler.Validator.validate(Validator.java:1737)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:178)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
My Jsp file (pieChartLive.jsp)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>PieChartLive</title>
<p:resources />
</head>
<body>
<h:form id="livePieChartForm">
<p:pieChart id="votes" value="#{PieChartLiveBean.lunchSalesList}"
var="lunchSalesBean" live="true" refreshInterval="3000"
categoryField="#{lunchSalesBean.dishName}"
dataField="#{lunchSalesBean.salesPercentage}" />
</h:form>
</body>
My web.xml
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
PrimeFaces
pieChartLive.jsp
<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>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>cupertino</param-value>
</context-param>
My faces-config.xml
<faces-config>
<managed-bean>
<managed-bean-name>PieChartLiveBean</managed-bean-name>
<managed-bean-class>com.sample.primefaces.PieChartLiveBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
You are mixing jsp and facelets. Your facelet has file suffix .jsp but your web.xml mapping for the Faces Servlet is *.jsf. So the Faces Servlet won't be invoked.
Change the file suffix to .jsf and try again.