From: Simon Kitching <[EMAIL PROTECTED]>
Reply-To: "MyFaces Discussion" <[email protected]>
To: MyFaces Discussion <[email protected]>
Subject: Re: Faces context not found
Date: Fri, 30 Mar 2007 07:57:46 +1200
Eugine Fosah wrote:
Hi everyone out there
I am developing an application with JSF. I am having the follwing in my
web.xml.
<servlet> <servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup> 1 </load-on-startup> </servlet> <!-- Faces Servlet
Mapping --> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern> </servlet-mapping>
My index page has the following. When the appilcation is loaded, the page
that has to be shown is the index page. I however always get the following
exception:
" Faces context not found. getResponseWriter will fail. Check if the
FacesServlet has been initialized at all in your web.xml. 29.03.2007
20:14:56 org.apache.catalina.core.StandardWrapperValve invoke
"Faces context not found. getResponseWriter will fail. Check if the
FacesServlet has been initialized at all in your web.xml."
On the browser I see a NullpointerException pointinmg to the line where I
use EL to gat a bean property which I defined. "#{datebean.dateString }
This bean and properties have all been properly
set.
Can anyone help?
thanks in advance
This will happen if you access the page like:
http://yourhost/yourwebapp/somepage.jsp
because the jsp page will execute, try to invoke a JSF tag and that tag
will report this error because the servlet handling the request is the jsp
servlet, NOT the jsf servlet.
I would expect the problem is that you are somehow accessing a jsp page
using a url that doesn't have "/faces" at the start.
* What's the URL that you have entered in the browser?
* Do you have security constraints that force a redirect to a different
page?
* Does your web.xml have an index-file declaration that specifies a jsp
page as the target, without the "/faces" prefix?
Regards, Simon
Hello Simon,
Thanks you got it all. That was the problem. I used index.jsp as my welcome
file in the web xml. The <url-pattern> /faces/*</url-pattern> was equally
not availabe. So it id just what u said. A jsp trying to invoke JSF tag.
Thanks for that once more
Eugine
_________________________________________________________________
Wenn Ihnen E-Mail nicht schnell genug ist: MSN Messenger! -
http://www.imagine-msn.com/messenger/default2.aspx?locale=de Kostenlos
downloaden!