当前位置: 代码迷 >> Eclipse >> MyEclipse5.0建立JSF的有关问题
  详细解决方案

MyEclipse5.0建立JSF的有关问题

热度:223   发布时间:2016-04-23 14:39:50.0
MyEclipse5.0建立JSF的问题
出现如下错误:
message  

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

exception  

javax.servlet.ServletException:   Cannot   find   FacesContext
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.MyJsp_jsp._jspService(MyJsp_jsp.java:94)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root   cause  

javax.servlet.jsp.JspException:   Cannot   find   FacesContext
javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:399)
com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:105)
org.apache.jsp.MyJsp_jsp._jspx_meth_f_view_0(MyJsp_jsp.java:109)
org.apache.jsp.MyJsp_jsp._jspService(MyJsp_jsp.java:84)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


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


--------------------------------------------

我用的是eclipse3.2+Myeclipse5.0,tomcat5.0   jdk1.4.
希望高人给我解决解决.


------解决方案--------------------
URL 地址输错了 看你的WEB.XML
<servlet-mapping>
<servlet-name> Faces Servlet </servlet-name>
<url-pattern> *.jsf </url-pattern>
</servlet-mapping>

这里 <url-pattern> 默认应该是 /faces/* 那你就在JSP前面加这个faces/

否则不会被Faces Servlet解析 就报错
------解决方案--------------------
检查配置文件中的Faces Servlet映射路径
代码迷推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.daimami.com/search?q=317
  相关解决方案