Originally posted by Awais Sheikh:
Have you set your class path?? Please place these files in lib folder of tomcat and include these jar files in your class path.
servlet-api.jar
jsp-api.jar
jsf-api.jar
jsf-impl.jar
Hope it works.
Originally posted by rathi ji:
I managed to handle second example (simple jsp file), but finding very surprise behaviour:
1. I created one more file, test.faces (name of jsp file is also test (test.jsp)), which has the same code of jsp file (test.jsp)
2. I changed mapping in web.xml like this:
Now, I am able to see the output of test.jsp when I open test.faces (http://localhost:8081/JSFLogin/pages/test.faces).
If I try to view jsp file (http://localhost:8081/JSFLogin/pages/test.jsp), then I get this exception:
And If I change test.jsp and keep test.faces as it is, and I open test.faces, then I can see the changes done by me (so actually it is the output of jsp file but still browser has this URL: http://localhost:8081/JSFLogin/pages/test.faces)
very-very confused.
Thanks.
[ July 06, 2006: Message edited by: rathi ji ]
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Originally posted by Tim Holloway:
That first step is the hardest, isn't it?
Let's see if I can help.
First, define your JSF pages as ".jsp" files, except that you'll need an <f:view> in them to wrap the JSF tags.
Next, setup a URL mapping in web.xml:
Some prefer "/faces/" as part of the URL pattern.
Now build a WAR and fire up the webapp. To get the JSF rendition of "hello.jsp", type in the URL: jsf[/b]]http://localhost:8080/mywebapp/hello.jsf . Your URL may vary depending on host port and app context name.
If you invoke jsp[/b],]http://localhost:8080/mywebapp/hello.jsp, you'll bypass the Faces servlet and get errors. The Faces servlet knows to drop the ".jsf" and add a ".jsp" when it goes to build the view page.
Originally posted by Awais Sheikh:
You can write your own extensions what ever u want as I am using my own names extensions. .
You wrote "Now, I am able to see the output of test.jsp when I open test.faces (http://localhost:8081/JSFLogin/pages/test.faces)".
You write test.faces instead of test.jsp because in mapping file you mentioned ".faces" extension in url-pattern.
Now, Mr. Tim used ".jsf" in url-pattern in web.xml thats why he wrote hello.jsf.
So, make it sure that you have changed in your web.xml file and restared your webserver after deploying war file.
Hope this will help you, if you have any other confusion feel free to ask.
Thanks,
Awais
Don't get me started about those stupid light bulbs. |