Help with deploying simple JSF application in JBOSS

Hey i am new to both JSF and JBOSS. can anyone please let me know how to deploy a sample JSF in JBOSS.

I am copying the files here.Thanks a lot in advance.

web.xml

<?xml version="1.0"?>

<web-app 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"

version="2.4">

<context-param>

<param-name>javax.faces.CONFIG_FILES</param-name>

<param-value>/WEB-INF/faces-config.xml</param-value>

</context-param>

<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>

</web-app>

faces.config.xml

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

<!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>

<navigation-rule>

<from-view-id>WEB-INF/Register.jsp</from-view-id>

<navigation-case>

<from-outcome>Register</from-outcome>

<to-view-id>WEB-INF/results/result.jsp</to-view-id>

</navigation-case>

</navigation-rule>

</faces-config>

Register.jsp

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

<f:view>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>

<HEAD><TITLE>New Account Registration</TITLE>

<LINK REL="STYLESHEET"

HREF="./css/styles.css"

TYPE="text/css">

</HEAD>

<BODY>

<CENTER>

<TABLE BORDER=5>

<TR><TH CLASS="TITLE">New Account Registration</TH></TR>

</TABLE>

<P>

<h:form>

Email address: <h:inputText/>

Password: <h:inputSecret/>

<h:commandButton value="Sign Me Up!" action="register"/>

</h:form>

</CENTER></BODY></HTML>

</f:view>

result.jsp

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>

<HEAD><TITLE>Success</TITLE>

<LINK REL="STYLESHEET"

HREF="./css/styles.css"

TYPE="text/css">

</HEAD>

<BODY>

<CENTER>

<TABLE BORDER=5>

<TR><TH CLASS="TITLE">Success</TH></TR>

</TABLE>

<H2>You have registered successfully.

(Version 1)</H2>

</CENTER>

</BODY></HTML>

HERE is my Eclipse structure

JavaServerFaces (root folder)

WEB-INF

faces.config.xml

web.xml

Register.jsp

Results

result.jsp

lib

(all lib files)

Please help me.

[3494 byte] By [sriia] at [2007-11-27 1:00:36]
# 1

Hi,

To run a JSF application on JBoss Server u must have JBOSS 4.2.0 . less than Jboss 4.2.0 versions doesn't support the JSF. Because it's is something with the servlet container. After having the jboss 4.2.0 server u deploy simple jsf application war file in server/default/deploy it will work fine. JSF example turtorial war files u can get it by searching with google

vijaycanaan

vijaycanaana at 2007-7-11 23:35:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

That's funny, I must be imaging the JBoss 3.2.8 instance I have running here with several JSF apps.. :-)

I think what vijaycanaan means is that you may or may not need the JSF implementation JARS (jsf-api.jar, jsf-impl.jar) in WEB-INF\lib depending on your version of JBoss. Some JBoss versions come with a JSF implementation included in their bundled Tomcat, some don't.

I think there is some documentation on the JBoss wiki:

http://www.jboss.org/wiki/Wiki.jsp?page=JBossFaces

Back to the problem srii. You haven't actually said what your problem is. What pages are you requesting? Are you getting any error messages?

From your Eclipse structure it looks like you're putting the JSP files into WEB-INF. You shouldn't do this: put them in the root of your WAR.

guy.colemana at 2007-7-11 23:35:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Hey thanks a lot...I was not deploying in the right folder...its working now.
sriia at 2007-7-11 23:35:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
JBoss 4.0.2 itself haveing default MyFaces jar files
KrishnaSa at 2007-7-11 23:35:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...