Thanks a lot for your reply. I will list all the files in my web app here because it is a very simple web app with a single jsp page and only one jsf backing bean.
The war file's name is
jsfbean2, so the extracted folder name is also the same.
The URL's I tried are,
http://127.0.0.1:8080/jsfbean2/faces/Register.jsp http://127.0.0.1:8080/jsfbean2/Register.jsp http://127.0.0.1:8080/jsfbean2/Register.jsf http://127.0.0.1:8080/jsfbean2/Register.faces http://127.0.0.1:8080/jsfbean2/faces/Register All those gives HTTP Status 404 Error...
INSIDE WEB-INF My web.xml file: <?xml version = '1.0' encoding = 'windows-1252'?>
<web-app 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" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
<description>Empty web.xml file for Web Application</description>
<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>
<session-config>
<session-timeout>35</session-timeout>
</session-config>
<mime-mapping>
<extension>html</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
<mime-mapping>
<extension>txt</extension>
<mime-type>text/plain</mime-type>
</mime-mapping>
</web-app>
and my faces-config.xml file (INSIDE WEB-INF): <?xml version="1.0" encoding="windows-1252"?>
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config xmlns="http://java.sun.com/JSF/Configuration">
<managed-bean>
<managed-bean-name>personData</managed-bean-name>
<managed-bean-class>proj1.PersonInfo</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</faces-config>
In classes/proj1 folder PersonInfo.class it's source code:
package proj1;
public class PersonInfo {
public PersonInfo() {
}
private String username;
private String email;
public void setUsername(String username) {
this.username = username;
}
public String getUsername() {
return username;
}
public void setEmail(String email) {
this.email = email;
}
public String getEmail() {
return email;
}
public void saveInfo (String name, String mail) {
System.out.println("saving..." + name + " " + mail);
}
public String commandButton_action() {
saveInfo (this.username, this.email);
return null;
}
}
Outside the WEB-INF folder, there is only one jsp file.
Register.jsp <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
<f:view>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=windows-1252"/>
<title>Home Page</title>
<style type="text/css">
body {
background-color: #ffefd6;
}
</style>
</head>
<body><font size="4">
<font color="#0000ff">
<h:form>
<p>
<font face="Andale Sans" size="5" color="#ff9494">
<strong>Registration Form</strong>
</font>
</p>
<table cellspacing="2" cellpadding="3" border="1" width="100%">
<tr>
<td>
<font color="#ff8484">
User Name
</font></td>
<td>
<font color="#ff8484">
<h:inputText value="#{personData.username}"/>
</font>
</td>
</tr>
<tr>
<td>
<font color="#ff8484">
Email
</font></td>
<td>
<font color="#ff8484">
<h:inputText value="#{personData.email}"/>
</font>
</td>
</tr>
<tr>
<td>
<font color="#ff8484">
</font></td>
<td>
<font color="#ff8484">
<h:commandButton value="Sign Up !"
action="#{personData.commandButton_action}"/>
</font>
</td>
</tr>
</table>
<p>
</p>
</h:form>
</font>
</font></body>
</html>
</f:view>
<%--
oracle-jdev-comment

referred-managed-bean-name

ersonData
--%>
Thanks for your kind attention!
Ranjith Kodikara (SCJP,SCWCD)
[email protected]