how to install jsf

hi all .

i using eclipse 3.3 and tomcat 5.5 to work with jsf. First, i create a project with jsf 1.1 support and copy : jsf-api.jar, jsf-impl.jar , jstl.jar and standar.jar to /WEB-INF/lib . this is my web.xml

<?xml version="1.0" encoding="UTF-8"?>

<web-app id="WebApp_ID" version="2.4"

xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<display-name>

webfaces</display-name>

<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>index.htm</welcome-file>

<welcome-file>index.jsp</welcome-file>

<welcome-file>default.html</welcome-file>

<welcome-file>default.htm</welcome-file>

<welcome-file>default.jsp</welcome-file>

</welcome-file-list>

</web-app>

try to run a jsp file (without any jsf tag) , i take this :

HTTP Status 404 - /webfaces/faces/index.jsp

type Status report

message /webfaces/faces/index.jsp

description The requested resource (/webfaces/faces/index.jsp) is not available.

Apache Tomcat/5.5.23

i've try add this to web.xml :

<listener><listener-class>com.sun.faces.config.ConfigureListener</listener-class>

</listener>

but nothing change . humm, it's take me a day but can't solve the problem , please help me ! thanks.

Message was edited by:

secmask

[2178 byte] By [secmaska] at [2007-11-27 10:24:39]
# 1

Are you sure that Tomcat has deployed your application under the /webfaces URL? I'm not very familiar with Tomcat (I use JBoss, which uses Tomcat) so I can't speculate based on what you've told us. I imagine that Tomcat issues a message when it deploys an app under a context, perhaps you could find that.

RaymondDeCampoa at 2007-7-28 17:29:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

yes , i'm sure , webfaces is my project name. Every page with eclipse + tomcat will be access such as : http://localhost:8080/projectname/...path to the page.

secmaska at 2007-7-28 17:29:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

The project name is OK and the deployment is OK, you would get a different error message otherwise ;)

This error message means that the /faces/index.jsp is simply not available inside the project. What is the actual location of the desired file in your project? It expects that it is located in WebContent/faces/index.jsp. Is this actually correct? You could also try another URL mapping pattern:

<url-pattern>*.jsf</url-pattern>

and simply use the actual path, but replace .jsp with .jsf. For example http://localhost:8080/webroot/index.jsf

BalusCa at 2007-7-28 17:29:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

thanks for help me

path of my jsp file is located at "Web Content/index.jsp" and when run with "run on server" its address is "http://localhost:8080/webfaces/faces/index.jsp"

i've try other addess such as "http://localhost:8080/webfaces/faces/index.jsf"

or make a folder "Web Content/faces" and locate index.jsp there , but result is the same.

i don't understand the mean of "<url-pattern>*.jsf</url-pattern>" . what does "*.jsf" mean ?

hix, config to run jsf is so complicate !!! , do i missing any lib or thing ?

secmaska at 2007-7-28 17:29:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

It is not complicated .. You just need to *understand* it ;)

1) Put index.jsp right in the root of WebContent (not in a folder!)

2) Change url-pattern to *.jsf and restart webserver.

3) Call page on http://localhost:8080/webfaces/index.jsf

BalusCa at 2007-7-28 17:29:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

okie, i've found my missing, it's when create project with eclipse, in the "Components Liraries" step , i create two lirabary :

1 - COMMON with : commons-beanutils-1.6.jar,commons-collections-2.1.jar ,commons-digester-1.5.jar, commons-logging-1.0.3.jar

2- JSTL : standard-1.1.0.jar, jstl-1.1.0.jar

and add them to my project --> run ok

but strange thing that if i don't add them at this time, then when the project is created , i add these library manual by go to "Project --> Properties --> Java build path" (add to "Libraries" and "Oder and Export " ) --> run project will result an error as above. hum , what's different between them ? (other try at copy all *.jar file above and jsf*.jar to WEB-INF/lib still cause error )

so i don't know where should i locate these jar if i want to deploy my web ? I just want to do all by hand to understand how are they work.

thank for help .

secmaska at 2007-7-28 17:29:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...