[jboss-user] [EJB 3.0] - Re: java.lang.RuntimeException: Cannot find FacesContext

Wolfgang Knauf do-not-reply at jboss.com
Fri Jun 1 09:19:00 EDT 2007


Hi Ruchika,

I encountered the same problem with Suns RI.
The problem is: the faces context is initialized the first time you make a call to the faces servlet. This does not happen if yo call the page directly.

Solution 1:
browse to "welcome.faces" (or "welcome.jsf", depending on the faces url pattern) instead of "welcome.jsp".

Solution 2:
build a plain JSP index page which links to your faces page. This index page should contain this link:
<a href="welcome.faces">Start page</a>

Solution 3:
the index page contains a redirect to your jsf page:
<%@ page session="false" language="java" contentType="text/html; charset=ISO-8859-1"%>
  | <% response.sendRedirect("geometricmodel.faces"); %>

Hope this helps

Wolfgang

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

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



More information about the jboss-user mailing list