嗨,朋友们JSF Primefifaces图表没有显示我在应用程序中使用以下.jar文件
1)primefaces-3.0.M1.jar
2)jstl-1.0.2.jar
3)jsf-impl.jar
4)jsf-api.jar
但我的低于异常
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)
我的Jsp文件(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>
我的web.xml
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"id="WebApp_id"版本="2.5">PrimeFacespieChartLive.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>
我的面配置.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>
您正在混合jsp和facelets。您的facelet有文件后缀.jsp,但FacesServlet的web.xml映射是*.jsf。因此不会调用FacesServet。
请将文件后缀更改为.jsf,然后重试。