开发者

Primefaces charts Error

开发者 https://www.devze.com 2023-03-14 19:28 出处:网络
Hi Friends JSF primefaces charts not display i am using following .jar files in my application 1)primefaces-3.0.M1.jar

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消