File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes JSF/MyFaces and Sitemesh Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF/MyFaces and Sitemesh" Watch "JSF/MyFaces and Sitemesh" New topic

JSF/MyFaces and Sitemesh

Mathias Berg

Joined: Oct 03, 2007
Posts: 5
Hi all, im having problem with JSF code in my sitemesh decorator files. i get this error if im putting in some JSF code, like <f:view> ... </f:view> in my default decorator file. It works fine in my other JSP files (Those that displays through the <decorator:body/> tag)

javax.faces.FacesException: Faces context not found. getResponseWriter will fail. Check if the FacesServlet has been initialized at all in your web.xml configuration fileand if you are accessing your jsf-pages through the correct mapping. E.g.: if your FacesServlet is mapped to *.jsf (with the -element), you need to access your pages as 'sample.jsf'. If you tried to access 'sample.jsp', you'd get this error-message.
at javax.faces.webapp.UIComponentTag.setupResponseWriter(
at javax.faces.webapp.UIComponentTag.doStartTag(
at org.apache.myfaces.taglib.core.ViewTag.doStartTag(
at org.apache.jsp.decorators.default_jsp._jspx_meth_f_005fview_005f0(
at org.apache.jsp.decorators.default_jsp._jspService(
at org.apache.jasper.runtime.HttpJspBase.service(
at javax.servlet.http.HttpServlet.service(


Anyone got this problem, solved it also maybe :-)

My env is:

Tomcat 5.5 / Servlet 2.4.
myfaces, 1.1.5
sitemesh, 2.2.1
I agree. Here's the link:
subject: JSF/MyFaces and Sitemesh
It's not a secret anymore!