日期:2014-05-20  浏览次数:20719 次

我照JSF写的入门程序,但是报错说找不着Face Servlet实例。
我现在的问题就是网页能找到index.jsp文件。如果我把 <f:view> </f:view> 删了的话,能显示一个带标题的网页。但是,报错
说无法初始化FaceSevrlet。我想是不是,我的       |-myface-api-1.1.4.jar
    |-myfaces-impl-1.1.4.jar文件放错了,但是我放在WEB-INF的lib中也出现这个错,我再查web.xml,觉得FaceServlet没有写错啊
        <servlet>
                <servlet-name> Faces   Servlet </servlet-name>
                <servlet-class>
                        javax.faces.webapp.FacesServlet
                </servlet-class>
                <load-on-startup> 1 </load-on-startup>
        </servlet>
不就是在WEB启动时初始化一个Faces   Servlet的实例吗,
        <servlet-mapping>
                <servlet-name> Faces   Servlet </servlet-name>
                <url-pattern> *.faces </url-pattern>
        </servlet-mapping>
     
        <welcome-file-list>
                <welcome-file> pages/index.jsp </welcome-file>
        </welcome-file-list>
所有的*.faces资源对应的*.jsp文件。那错误在哪里呢,真的想不出来。
严重:   Faces   context   not   found.   getResponseWriter   will   fail.   Check   if   the   FacesServlet   has   been   initialized   at   all   in  

your   web.xml.
2007-6-5   8:22:29   org.apache.catalina.core.StandardWrapperValve   invoke
严重:   Servlet.service()   for   servlet   jsp   threw   exception
java.lang.NullPointerException
at   javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:929)
at   javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:310)
at   org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:70)
at   org.apache.jsp.pages.index_jsp._jspx_meth_f_view_0(index_jsp.java:86)
at   org.apache.jsp.pages.index_jsp._jspService(index_jsp.java:61)
at   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)