有JavaServer Faces高手吗?遇到麻烦了,急!!!

05-12-12 diven_net

我下载了jsf-1_1_01压缩包,把里面的LIB目录下的JAR文件拷贝到了TOMCAT5.5的../WEB-INF/lib/下,编译的时候出现错误:
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /validatorTest.jsp(8,1) No tag "use_faces" defined in tag library imported with prefix "f"
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:196)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1317)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1573)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.12 logs.

还有JAR文件没有关联进来,但jsf-1_1_01压缩包也就那么几个JAR文件?该怎么弄啊........

恳请留下您的QQ,谢谢!!!

diven_net
2005-12-12 20:06

我把jakarta-taglibs-standard-1.1.2 和jsf-1_1_01目录下的lib目录下的jar都拷到了Web项目的WEB-INF/lib下
报这个错误:org.apache.jasper.JasperException: /validatorTest.jsp(8,1) No tag "use_faces" defined in tag library imported with prefix "f"

代码:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<html>
<head>
<title>Validator Test</title>
</head>
<body>
<f:use_faces>
<h:form formName="myForm">
Enter a minimum of 6 characters here:
<h:input_text>
<f:validate_length minimum="6"/>
</h:input_text>
<br/>
<h:commad_button label="Submit" commandName="submit"/>
<br/>
<h:output_errors>
</h:form>
</f:use_faces>
</body>
</html>
怎么会没着标签呢,是书上的例子啊,这书h 和f标签是不是都弄错了,还是版本太老?《JavaServer Faces编程》(美)Budi Kurniawan 著 清华大学出版社

diven_net
2005-12-12 20:07

怎么代码看不到?
这书的标签都写成:<f:use_faces> <f:validate_length><h:input_text>

diven_net
2005-12-12 20:11



//
<f:use_faces>
<h:form formName=
"myForm">
Enter a minimum of 6 characters here:
<h:input_text><f:validate_length minimum=
"6"></h:input_text>
<br/>
<h:command_button label=
"submit" commandName="submit"/>
<br/>
<h:output_errors/>
</h:form>
</f:use_faces>

diven_net
2005-12-12 20:25



<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri=
"http://java.sun.com/jsf/core" prefix="f"%>
<html>
<head>
<title>Validator Test</title>
</head>
<body>
<f:view>
<h:form>
Enter a minimum of 6 characters here:
<h:inputText>
<f:validateLength minimum=
"6"/>
</h:inputText>
<br/>
<h:commandButton value=
"Submit" />
<br/>
</h:form>
</f:view>
</body>
</html>

通过修改终于可以执行了,不过显示错误消息的该是哪个标签呢?
难道那本书真的搞错了?还是 2005年1月第一次印刷 的,其实这书讲的挺好的,怎么会把标签弄错了呢...........

哪位前辈推荐几本好书吧.................

3Go 1 2 3 下一页