按教程复制代码运行时出现错误 /pages/welcome.jsp(3,45) equal symbol expected

hailong4688199 2010-01-14
严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /pages/welcome.jsp(3,45) equal symbol expected
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
at org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:194)
at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:144)
at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:157)
at org.apache.jasper.compiler.ParserController.getPageEncodingForJspSyntax(ParserController.java:435)
at org.apache.jasper.compiler.ParserController.determineSyntaxAndEncoding(ParserController.java:378)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:170)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)



welcome.jsp的代码:
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@page contentType="text/html;charset=UTF-8"%>
<html>
<head>
<title>第一个JSF程序</title>
</head>
<body>
    <f:view>
        <h:outputText value = "#{user.name}"/> 您好!
        <h3>欢迎使用 JavaServer Faces!</h3>
    </f:view>
</body>
</html>

face配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">

<faces-config>
<navigation-rule>
<from-view-id>/pages/index.jsp</from-view-id>
<navigation-case>
<from-outcome>login</from-outcome>
<to-view-id>/pages/welcome.jsp</to-view-id>
</navigation-case>
</navigation-rule>

<managed-bean>
<managed-bean-name>user</managed-bean-name>
<managed-bean-class>onlyfun.test.UserBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config>
terryzhou 2010-01-14
贴你输入的URL和WEB.XML
hailong4688199 2010-01-15
web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
  <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml</param-value>
  </context-param>
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
  </servlet-mapping>

</web-app>

url:http://localhost:8080/JSFtest/pages/index.faces
hailong4688199 2010-01-15
不好意思,好像是我部署出错了。。。
Global site tag (gtag.js) - Google Analytics