comprei o livro indicado aqui no forun core jsf.
o problema e que o livro usa eclipse e eu uso netbeans.
fiz o primeiro exércicio, e estou com um problema:
ele diz que o web.xml não reconhece as tags,
<%@ taglib uri=“http://java.sun.com/jsf/core” prefix=“f” %>
<%@ taglib uri=“http://java.sun.com/jsf/html” prefix=“h” %>
e da o seguinte erro na hora de copilar:
HTTP Status 404 - Servlet Faces Servlet is not available
type Status report
message Servlet Faces Servlet is not available
description The requested resource (Servlet Faces Servlet is not available) is not available.
Apache Tomcat/5.5.17
eu to pra queimar este livro !
os fontes:
index.jsp
<html>
<%@ taglib uri=“http://java.sun.com/jsf/core” prefix=“f” %>
<%@ taglib uri=“http://java.sun.com/jsf/html” prefix=“h” %>
<f:view>
<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>
<h:commandButton value=“Login” action=“login”/>
</h:form>
</body>
</f:view>
</html>
index.html
<html>
<head>
<meta http-equiv=“Refresh” content= “0; URL=index.faces”/>
<title>Start Web Application</title>
</head>
<body>
Please wait for the web application to start.
</body>
</html>
welcome.jsp
<html>
<%@ taglib uri=“http://java.sun.com/jsf/core” prefix=“f” %>
<%@ taglib uri=“http://java.sun.com/jsf/html” prefix=“h” %>
<f:view>
<head>
<title>A Simple JavaServer Faces Application</title>
</head>
<body>
<h:form>
<h3>
Welcome to JavaServer Faces,
<h:outputText value="#{user.name}"/>!
</h3>
</h:form>
</body>
</f:view>
</html>
UserBean.java
package com.corejsf;
public class UserBean {
private String name;
private String password;
// PROPERTY: name
public String getName() { return name; }
public void setName(String newValue) { name = newValue; }
// PROPERTY: password
public String getPassword() { return password; }
public void setPassword(String newValue) { password = newValue; }
}
context.xml
<?xml version=“1.0” encoding=“UTF-8”?>
<Context path="/ch1"/>
web.xml
<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC
“-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN”
“http://java.sun.com/dtd/web-app_2_3.dtd”>
<web-app>
<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>
</web-app>
faces-config.xml
<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC
“-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN”
“http://java.sun.com/dtd/web-facesconfig_1_0.dtd”>
<faces-config>
<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>
</faces-config>
.calssespacht
<?xml version=“1.0” encoding=“UTF-8”?>
<classpath>
<classpathentry kind=“src” path=“WEB-INF/classes”/>
<classpathentry kind=“lib” path=“build/WEB-INF/lib/commons-digester.jar”/>
<classpathentry kind=“lib” path=“build/WEB-INF/lib/jsf-impl.jar”/>
<classpathentry kind=“lib” path=“build/WEB-INF/lib/jstl.jar”/>
<classpathentry kind=“lib” path=“build/WEB-INF/lib/standard.jar”/>
<classpathentry kind=“lib” path=“build/WEB-INF/lib/commons-beanutils.jar”/>
<classpathentry kind=“lib” path=“build/WEB-INF/lib/jsf-api.jar”/>
<classpathentry kind=“con” path=“org.eclipse.jdt.launching.JRE_CONTAINER”/>
<classpathentry kind=“src” path="/jsflibs"/>
<classpathentry kind=“output” path=“build/WEB-INF/classes”/>
</classpath>
.projetc
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>login</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
se alguem puder ajudar eu ficaria muito grato !, será que vou ter que fazer o eclipse ?