[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - Cannot find FacesContext

rodosa do-not-reply at jboss.com
Sun Apr 13 13:08:03 EDT 2008


Hello!

      I've a doubt ... Why the index.jspx can't contain any jsf tag like <h:commandButton/> or similar? The error that it's thrown is:


  | 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.index_jsp._jspx_meth_f_view_0(index_jsp.java:84)
  | org.apache.jsp.index_jsp._jspService(index_jsp.java:60)
  | 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)
  | 

    But, If I put the index.faces in the browser I could see perfectly the page.

    In my web.xml I have:


  | <welcome-file-list>
  |     <welcome-file>index.jspx</welcome-file>
  |   </welcome-file-list>
  |   
  |   <servlet>
  |     <servlet-name>Faces Servlet</servlet-name>
  |     <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
  |     <load-on-startup>0</load-on-startup>
  |   </servlet>
  |  
  |    <!-- Faces Servlet Mapping -->
  |     <servlet-mapping>
  |         <servlet-name>Faces Servlet</servlet-name>
  |         <url-pattern>*.faces</url-pattern>
  |     </servlet-mapping>
  |   
  |   <context-param>
  |   	<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
  |   	<param-value>.jspx</param-value>
  |   </context-param>
  | 

I've solucionated this, using the <jsp:foward> tag that redirect to other pages in which I could use the jsf tags. But what is the reason for that? The Faces context load is lazy? Is there any other solution for that issue?

Thanks

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4143723#4143723

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4143723



More information about the jboss-user mailing list