Cannot find FacesContext

View: New views
9 Messages — Rating Filter:   Alert me  

Cannot find FacesContext

by Russell Bateman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm trying to put together Core JavaServer Faces' login example from chapter 1, but I get an HTTP 500 error once I reach my index.jsp:
exception
org.apache.jasper.JasperException: java.lang.RuntimeException: Cannot find FacesContext
.
.
.
root cause
java.lang.RuntimeException: Cannot find FacesContext
	javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1811)
	javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1628)
	org.apache.jsp.index_jsp._jspx_meth_f_005fview_005f0(index_jsp.java:94)
I have done the NetBeans tutorial on JSF and it works. Only, I'm trying to grow the concepts (nitty-gritty JSF) from Geary/Horstmann up to NetBeans. In NetBeans 6.1, lots of work is done behind the scenes, but if I grok something at the low level, I don't always know how to relate (or do) it at the Visual Web JSF level. I'm thinking once I've gone from the bottom up after having gone from the top down, some important notions might begin to click.

The login example at netbeans.org is for version 5.5 and much has changed since then (or so it appears to me) and that tutorial didn't get me very far.

I hope someone has a good suggestion.

Russ

Re: Cannot find FacesContext

by wbossons :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


How is your faces servlet configured?

<servlet> ....
   <servlet-name>Faces Servlet ....

....
</servlet>
<servlet-mapping> .....

.....

</servlet-mapping>

..\W

Russell Bateman wrote:
I'm trying to put together Core JavaServer Faces' login example from chapter 1, but I get an HTTP 500 error once I reach my index.jsp:
exception
org.apache.jasper.JasperException: java.lang.RuntimeException: Cannot find FacesContext
.
.
.
root cause
java.lang.RuntimeException: Cannot find FacesContext
	javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1811)
	javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1628)
	org.apache.jsp.index_jsp._jspx_meth_f_005fview_005f0(index_jsp.java:94)
  
I have done the NetBeans tutorial on JSF and it works. Only, I'm trying to grow the concepts (nitty-gritty JSF) from Geary/Horstmann up to NetBeans. In NetBeans 6.1, lots of work is done behind the scenes, but if I grok something at the low level, I don't always know how to relate (or do) it at the Visual Web JSF level. I'm thinking once I've gone from the bottom up after having gone from the top down, some important notions might begin to click.

The login example at netbeans.org is for version 5.5 and much has changed since then (or so it appears to me) and that tutorial didn't get me very far.

I hope someone has a good suggestion.

Russ


-- 
..\Wendy
Wendy Bossons
Senior User Interface Developer
Harvard-MIT Data Center
Office Phone:  617-384-5701
Email: wbossons <at> hmdc.harvard.edu 

Re: Cannot find FacesContext

by Russell Bateman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank for responding. In an effort to shorten the question and answer cycle before it discourages you from helping, I'm including pretty much the whole source here. I'm not at home where I'm doing this, but to answer your first question directly, here are the guts of 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>  

   <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.faces</url-pattern>
   </servlet-mapping> 

   <welcome-file-list>
      <welcome-file>index.html</welcome-file>
   </welcome-file-list>

which I copied from Geary & Horstmann's first chapter. I also tried index.jsp as the welcome file, but entering index.html into the browser which contains

<html>
   <head>
      <meta http-equiv="Refresh" content= "0; URL=index.faces"/>
      <title>Start Web Application</title>
   </head>
   <body>
      <p>Please wait for the web application to start.</p>
   </body>
</html>

and works fine, so I kept it as they suggest. I am a little confused with the .faces vs. .jsp thing. I read that explanation several times in the book and still don't get it, but I've chaulked it  up to more web.xml hocus-pocus that I'll probably catch onto after I've gained a little more experience.

It's my JSP that doesn't work and gives the error whose summary I reported. Here are the guts of my index.jsp:

   <f:view>
      <html xmlns="http://www.w3.org/1999/xhtml">
         <head>
            <title>A Simple JavaServer Faces Application</title>
         </head>
         <body>        
            <h:form>
               <h3>Please enter your name and password.</h3>
               <table>
                  <tr>
                     <td>Name:</td>
                     <td><h:inputText value="#{user.name}"/></td>
                  </tr>
                  <tr>
                     <td>Password:</td>
                     <td><h:inputSecret value="#{user.password}"/></td>
                  </tr>
               </table>
               <p><h:commandButton value="Login" action="#{user.login}"/> </p>
            </h:form>
         </body>
      </html>
   </f:view>

and, just so you don't have to ask for it, the bean code is

package com.corejsf;

public class UserBean
{
   private String name;
   private String password;

   public String getName() { return name; }
   public void setName(String newValue) { name = newValue; }
   public String getPassword() { return password; }
   public void setPassword(String newValue) { password = newValue; }
  
   public String login() { return "login"; }
}

and faces-config.xml is (guts only):

   <navigation-rule>
      <from-view-id>/index.jsp</from-view-id>
      <navigation-case>
         <from-outcome>login</from-outcome>
         <to-view-id>/welcome.jsp</to-view-id>
      </navigation-case>
   </navigation-rule>

   <managed-bean>
      <managed-bean-name>user</managed-bean-name>
      <managed-bean-class>com.corejsf.UserBean</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
   </managed-bean>


As I alluded, I tried the GUI JSF sample from the NetBeans site and it worked fine. This time, I'm trying to type in (or get from the book source code) some code that was written and demonstrated outside of a GUI. In the book, Geary & Hortstmann compile directly with Java and then use GlassFish. I'm trying to use their code in NetBeans and Tomcat. I did this by setting up a normal JSF project, but then deleting the default Page1, Page2, etc. and adding my own files (index.html, index.jsp) plus the guts to web.xml and faces-config.xml. I'm in essence "growing" the Geary & Horstmann by-hand stuff into the NetBeans "we're doing all this cool stuff for you, but it will make it hard for you to figure out how to do it more by hand" GUI.

I'm in fact a refugee from Eclipse--challenged by a friend to try out NetBeans as a solution to the difficulty of doing JSF in that environment. So far, I'm way impressed, but I need to feel the connection between the lower-level theory and higher-level practices of NetBeans.

Thanks for any help you can give.

Russ


Wendy Bossons wrote:

How is your faces servlet configured?

<servlet> ....
   <servlet-name>Faces Servlet ....

....
</servlet>
<servlet-mapping> .....

.....

</servlet-mapping>

..\W

Russell Bateman wrote:
I'm trying to put together Core JavaServer Faces' login example from chapter 1, but I get an HTTP 500 error once I reach my index.jsp:
exception
org.apache.jasper.JasperException: java.lang.RuntimeException: Cannot find FacesContext
.
.
.
root cause
java.lang.RuntimeException: Cannot find FacesContext
	javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1811)
	javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1628)
	org.apache.jsp.index_jsp._jspx_meth_f_005fview_005f0(index_jsp.java:94)
  
I have done the NetBeans tutorial on JSF and it works. Only, I'm trying to grow the concepts (nitty-gritty JSF) from Geary/Horstmann up to NetBeans. In NetBeans 6.1, lots of work is done behind the scenes, but if I grok something at the low level, I don't always know how to relate (or do) it at the Visual Web JSF level. I'm thinking once I've gone from the bottom up after having gone from the top down, some important notions might begin to click.

The login example at netbeans.org is for version 5.5 and much has changed since then (or so it appears to me) and that tutorial didn't get me very far.

I hope someone has a good suggestion.

Russ


-- 
..\Wendy
Wendy Bossons
Senior User Interface Developer
Harvard-MIT Data Center
Office Phone:  617-384-5701
Email: wbossons <at> hmdc.harvard.edu 

Re: Cannot find FacesContext

by Russell Bateman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I mean, I tried skipping the index.html which forwards to index.jsp in an effort to solve this problem originally, but it didn't help.


Russell Bateman wrote:
.... I also tried index.jsp as the welcome file, ...

Re: Cannot find FacesContext

by wbossons :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

What is exactly is the url to your jsp? It's very possibly the issue ...

There are two possibilities to try in the faces-configuration.  My faces-config is configured to read /faces/* in the servlet mapping.  In this case, the /faces/ must be present in the path between the context and the index.jsp, otherwise the faces context will not be found, e.g. http://myserver/mycontext/index.jsp must be http://myserver/mycontext/faces/index.jsp

In your case -- *.faces, the .faces extension must be used, instead of .jsp, e.g. http://myserver/mycontext/index.faces.  Otherwise the faces servlet will not be accessed.

..\Wendy


Russell Bateman wrote:
Thank for responding. In an effort to shorten the question and answer cycle before it discourages you from helping, I'm including pretty much the whole source here. I'm not at home where I'm doing this, but to answer your first question directly, here are the guts of 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>  

   <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.faces</url-pattern>
   </servlet-mapping> 

   <welcome-file-list>
      <welcome-file>index.html</welcome-file>
   </welcome-file-list>

which I copied from Geary & Horstmann's first chapter. I also tried index.jsp as the welcome file, but entering index.html into the browser which contains

<html>
   <head>
      <meta http-equiv="Refresh" content= "0; URL=index.faces"/>
      <title>Start Web Application</title>
   </head>
   <body>
      <p>Please wait for the web application to start.</p>
   </body>
</html>

and works fine, so I kept it as they suggest. I am a little confused with the .faces vs. .jsp thing. I read that explanation several times in the book and still don't get it, but I've chaulked it  up to more web.xml hocus-pocus that I'll probably catch onto after I've gained a little more experience.

It's my JSP that doesn't work and gives the error whose summary I reported. Here are the guts of my index.jsp:

   <f:view>
      <html xmlns="http://www.w3.org/1999/xhtml">
         <head>
            <title>A Simple JavaServer Faces Application</title>
         </head>
         <body>        
            <h:form>
               <h3>Please enter your name and password.</h3>
               <table>
                  <tr>
                     <td>Name:</td>
                     <td><h:inputText value="#{user.name}"/></td>
                  </tr>
                  <tr>
                     <td>Password:</td>
                     <td><h:inputSecret value="#{user.password}"/></td>
                  </tr>
               </table>
               <p><h:commandButton value="Login" action="#{user.login}"/> </p>
            </h:form>
         </body>
      </html>
   </f:view>

and, just so you don't have to ask for it, the bean code is

package com.corejsf;

public class UserBean
{
   private String name;
   private String password;

   public String getName() { return name; }
   public void setName(String newValue) { name = newValue; }
   public String getPassword() { return password; }
   public void setPassword(String newValue) { password = newValue; }
  
   public String login() { return "login"; }
}

and faces-config.xml is (guts only):

   <navigation-rule>
      <from-view-id>/index.jsp</from-view-id>
      <navigation-case>
         <from-outcome>login</from-outcome>
         <to-view-id>/welcome.jsp</to-view-id>
      </navigation-case>
   </navigation-rule>

   <managed-bean>
      <managed-bean-name>user</managed-bean-name>
      <managed-bean-class>com.corejsf.UserBean</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
   </managed-bean>


As I alluded, I tried the GUI JSF sample from the NetBeans site and it worked fine. This time, I'm trying to type in (or get from the book source code) some code that was written and demonstrated outside of a GUI. In the book, Geary & Hortstmann compile directly with Java and then use GlassFish. I'm trying to use their code in NetBeans and Tomcat. I did this by setting up a normal JSF project, but then deleting the default Page1, Page2, etc. and adding my own files (index.html, index.jsp) plus the guts to web.xml and faces-config.xml. I'm in essence "growing" the Geary & Horstmann by-hand stuff into the NetBeans "we're doing all this cool stuff for you, but it will make it hard for you to figure out how to do it more by hand" GUI.

I'm in fact a refugee from Eclipse--challenged by a friend to try out NetBeans as a solution to the difficulty of doing JSF in that environment. So far, I'm way impressed, but I need to feel the connection between the lower-level theory and higher-level practices of NetBeans.

Thanks for any help you can give.

Russ


Wendy Bossons wrote:

How is your faces servlet configured?

<servlet> ....
   <servlet-name>Faces Servlet ....

....
</servlet>
<servlet-mapping> .....

.....

</servlet-mapping>

..\W

Russell Bateman wrote:
I'm trying to put together Core JavaServer Faces' login example from chapter 1, but I get an HTTP 500 error once I reach my index.jsp:
exception
org.apache.jasper.JasperException: java.lang.RuntimeException: Cannot find FacesContext
.
.
.
root cause
java.lang.RuntimeException: Cannot find FacesContext
	javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1811)
	javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1628)
	org.apache.jsp.index_jsp._jspx_meth_f_005fview_005f0(index_jsp.java:94)
  
I have done the NetBeans tutorial on JSF and it works. Only, I'm trying to grow the concepts (nitty-gritty JSF) from Geary/Horstmann up to NetBeans. In NetBeans 6.1, lots of work is done behind the scenes, but if I grok something at the low level, I don't always know how to relate (or do) it at the Visual Web JSF level. I'm thinking once I've gone from the bottom up after having gone from the top down, some important notions might begin to click.

The login example at netbeans.org is for version 5.5 and much has changed since then (or so it appears to me) and that tutorial didn't get me very far.

I hope someone has a good suggestion.

Russ


-- 
..\Wendy
Wendy Bossons
Senior User Interface Developer
Harvard-MIT Data Center
Office Phone:  617-384-5701
Email: wbossons <at> hmdc.harvard.edu 


-- 
..\Wendy
Wendy Bossons
Senior User Interface Developer
Harvard-MIT Data Center
Office Phone:  617-384-5701
Email: wbossons <at> hmdc.harvard.edu 

Re: Cannot find FacesContext

by Russell Bateman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you very much for responding. I've gone ahead also to try Kito Mann's first chapter example (JavaServer Faces in Action) and have had no success there either.

Yes, I assume it's a web.xml and/or faces-config.xml problem. However, I have tried /faces/* and *.faces as well as *.jsf and *.jsp. I have tried launching as localhost:8082/mycontext/{0,index.html,index.jsp,index.jsf,index.faces. I did not try it with /faces/ in the path and that sort of occurred to me, but I was letting NetBeans launch the server and choose the path, but it has so far betrayed me.

I just can't get oriented as to what the path means. Also, what's this "FacesContext" thing? I can't find it as a path or object, etc. anywhere. This afternoon, I'm home from work and I'm going to recreate these tutorials/samples very carefully in separate projects and experiment some more. I've just got to get over this hump and then, I think, I'll be sailing through what I really want to do (write a couple of web apps). I could give up and just go with JSP and servlets, but it's so 2000-ish and I really need to get into the modern age (although JSF isn't brand new either).

Thanks, I will try to couch a less open-ended and more intelligent question later today in this same thread.

Russ

Wendy Bossons wrote:
What is exactly is the url to your jsp? It's very possibly the issue ...

There are two possibilities to try in the faces-configuration.  My faces-config is configured to read /faces/* in the servlet mapping.  In this case, the /faces/ must be present in the path between the context and the index.jsp, otherwise the faces context will not be found, e.g. http://myserver/mycontext/index.jsp must be http://myserver/mycontext/faces/index.jsp

In your case -- *.faces, the .faces extension must be used, instead of .jsp, e.g. http://myserver/mycontext/index.faces.  Otherwise the faces servlet will not be accessed.

..\Wendy


Russell Bateman wrote:
Thank for responding. In an effort to shorten the question and answer cycle before it discourages you from helping, I'm including pretty much the whole source here. I'm not at home where I'm doing this, but to answer your first question directly, here are the guts of 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>  

   <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.faces</url-pattern>
   </servlet-mapping> 

   <welcome-file-list>
      <welcome-file>index.html</welcome-file>
   </welcome-file-list>

which I copied from Geary & Horstmann's first chapter. I also tried index.jsp as the welcome file, but entering index.html into the browser which contains

<html>
   <head>
      <meta http-equiv="Refresh" content= "0; URL=index.faces"/>
      <title>Start Web Application</title>
   </head>
   <body>
      <p>Please wait for the web application to start.</p>
   </body>
</html>

and works fine, so I kept it as they suggest. I am a little confused with the .faces vs. .jsp thing. I read that explanation several times in the book and still don't get it, but I've chaulked it  up to more web.xml hocus-pocus that I'll probably catch onto after I've gained a little more experience.

It's my JSP that doesn't work and gives the error whose summary I reported. Here are the guts of my index.jsp:

   <f:view>
      <html xmlns="http://www.w3.org/1999/xhtml">
         <head>
            <title>A Simple JavaServer Faces Application</title>
         </head>
         <body>        
            <h:form>
               <h3>Please enter your name and password.</h3>
               <table>
                  <tr>
                     <td>Name:</td>
                     <td><h:inputText value="#{user.name}"/></td>
                  </tr>
                  <tr>
                     <td>Password:</td>
                     <td><h:inputSecret value="#{user.password}"/></td>
                  </tr>
               </table>
               <p><h:commandButton value="Login" action="#{user.login}"/> </p>
            </h:form>
         </body>
      </html>
   </f:view>

and, just so you don't have to ask for it, the bean code is

package com.corejsf;

public class UserBean
{
   private String name;
   private String password;

   public String getName() { return name; }
   public void setName(String newValue) { name = newValue; }
   public String getPassword() { return password; }
   public void setPassword(String newValue) { password = newValue; }
  
   public String login() { return "login"; }
}

and faces-config.xml is (guts only):

   <navigation-rule>
      <from-view-id>/index.jsp</from-view-id>
      <navigation-case>
         <from-outcome>login</from-outcome>
         <to-view-id>/welcome.jsp</to-view-id>
      </navigation-case>
   </navigation-rule>

   <managed-bean>
      <managed-bean-name>user</managed-bean-name>
      <managed-bean-class>com.corejsf.UserBean</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
   </managed-bean>


As I alluded, I tried the GUI JSF sample from the NetBeans site and it worked fine. This time, I'm trying to type in (or get from the book source code) some code that was written and demonstrated outside of a GUI. In the book, Geary & Hortstmann compile directly with Java and then use GlassFish. I'm trying to use their code in NetBeans and Tomcat. I did this by setting up a normal JSF project, but then deleting the default Page1, Page2, etc. and adding my own files (index.html, index.jsp) plus the guts to web.xml and faces-config.xml. I'm in essence "growing" the Geary & Horstmann by-hand stuff into the NetBeans "we're doing all this cool stuff for you, but it will make it hard for you to figure out how to do it more by hand" GUI.

I'm in fact a refugee from Eclipse--challenged by a friend to try out NetBeans as a solution to the difficulty of doing JSF in that environment. So far, I'm way impressed, but I need to feel the connection between the lower-level theory and higher-level practices of NetBeans.

Thanks for any help you can give.

Russ


Wendy Bossons wrote:

How is your faces servlet configured?

<servlet> ....
   <servlet-name>Faces Servlet ....

....
</servlet>
<servlet-mapping> .....

.....

</servlet-mapping>

..\W

Russell Bateman wrote:
I'm trying to put together Core JavaServer Faces' login example from chapter 1, but I get an HTTP 500 error once I reach my index.jsp:
exception
org.apache.jasper.JasperException: java.lang.RuntimeException: Cannot find FacesContext
.
.
.
root cause
java.lang.RuntimeException: Cannot find FacesContext
	javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1811)
	javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1628)
	org.apache.jsp.index_jsp._jspx_meth_f_005fview_005f0(index_jsp.java:94)
  
I have done the NetBeans tutorial on JSF and it works. Only, I'm trying to grow the concepts (nitty-gritty JSF) from Geary/Horstmann up to NetBeans. In NetBeans 6.1, lots of work is done behind the scenes, but if I grok something at the low level, I don't always know how to relate (or do) it at the Visual Web JSF level. I'm thinking once I've gone from the bottom up after having gone from the top down, some important notions might begin to click.

The login example at netbeans.org is for version 5.5 and much has changed since then (or so it appears to me) and that tutorial didn't get me very far.

I hope someone has a good suggestion.

Russ


-- 
..\Wendy
Wendy Bossons
Senior User Interface Developer
Harvard-MIT Data Center
Office Phone:  617-384-5701
Email: wbossons <at> hmdc.harvard.edu 


-- 
..\Wendy
Wendy Bossons
Senior User Interface Developer
Harvard-MIT Data Center
Office Phone:  617-384-5701
Email: wbossons <at> hmdc.harvard.edu 

Re: Cannot find FacesContext

by Russell Bateman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I reached a solution by paying closer attention to Geary & Horstmann, but more so by experimentation. It turns out what was misleading was that they talked up three different web.xml vs. path vs. files which was misleading. After trying combinations of all of those, this is the (first) one that worked:

http://www.windofkeltia.com/j2ee/nb-tutorial/sources.html

I'm now working on the Kito Mann example to see if I learned anything and can get it working.

Thank you for your very useful help,

Russ


Wendy Bossons wrote:
What is exactly is the url to your jsp? It's very possibly the issue ...

There are two possibilities to try in the faces-configuration.  My faces-config is configured to read /faces/* in the servlet mapping.  In this case, the /faces/ must be present in the path between the context and the index.jsp, otherwise the faces context will not be found, e.g. http://myserver/mycontext/index.jsp must be http://myserver/mycontext/faces/index.jsp

In your case -- *.faces, the .faces extension must be used, instead of .jsp, e.g. http://myserver/mycontext/index.faces.  Otherwise the faces servlet will not be accessed.

..\Wendy


-- 
..\Wendy
Wendy Bossons
Senior User Interface Developer
Harvard-MIT Data Center
Office Phone:  617-384-5701
Email: wbossons <at> hmdc.harvard.edu 

Congrats - <EOM> Re: [nbusers] Cannot find FacesContext

by wbossons :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Russell Bateman wrote:
I reached a solution by paying closer attention to Geary & Horstmann, but more so by experimentation. It turns out what was misleading was that they talked up three different web.xml vs. path vs. files which was misleading. After trying combinations of all of those, this is the (first) one that worked:

http://www.windofkeltia.com/j2ee/nb-tutorial/sources.html

I'm now working on the Kito Mann example to see if I learned anything and can get it working.

Thank you for your very useful help,

Russ


Wendy Bossons wrote:
What is exactly is the url to your jsp? It's very possibly the issue ...

There are two possibilities to try in the faces-configuration.  My faces-config is configured to read /faces/* in the servlet mapping.  In this case, the /faces/ must be present in the path between the context and the index.jsp, otherwise the faces context will not be found, e.g. http://myserver/mycontext/index.jsp must be http://myserver/mycontext/faces/index.jsp

In your case -- *.faces, the .faces extension must be used, instead of .jsp, e.g. http://myserver/mycontext/index.faces.  Otherwise the faces servlet will not be accessed.

..\Wendy


-- 
..\Wendy
Wendy Bossons
Senior User Interface Developer
Harvard-MIT Data Center
Office Phone:  617-384-5701
Email: wbossons <at> hmdc.harvard.edu 


-- 
..\Wendy
Wendy Bossons
Senior User Interface Developer
Harvard-MIT Data Center
Office Phone:  617-384-5701
Email: wbossons <at> hmdc.harvard.edu 

First chapter tutorials to Core JSF and JSF in Action

by Russell Bateman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Last Friday, I became a frustrated refugee from Eclipse which was not
helping me learn JSF. NetBeans hasn't been a great deal more help, but
it did help some and I got some more in the form of succinct questions
from Wendy Bosson at Harvard pointing me in the right direction.

Lots of elbow grease and grunts later, I succeeded in almost getting
both examples working, not without taking a few pot-shots at decisions
made in the content of the two books or at both Eclipse and NetBeans.
(Always easy to criticize anyone else's work after it's done.)

If you're a frustrated beginner like me, maybe these notes will be of
some use to you. If you're already over the JSF hump, don't bother
(unless you're looking for comic relief at my expense).

Tutorial: JavaServer Faces in NetBeans, starts near bottom of page:

        http://www.windofkeltia.com/j2ee/nb-tutorial.html#skip