JBoss Community

New to JSF need help with generating Dynamic Content

created by kwilla M. in JBoss Tools - View the full discussion

HI,

I'm new to JSF and am trying to use the examples from the book "Begining JSF 2APIs and JBoss Seam" by kent Ka lok Tong. I followed all the instructions but when I run the .xhtml file from Eclipse the Dynamic Content is not showing. The following are the files created:

 

web.xml:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>hello11</display-name>
  <servlet>
    <servlet-name>JSF</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>JSF</servlet-name>
    <url-pattern>/faces/*</url-pattern>
  </servlet-mapping>
</web-app>

 

faces-config:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<faces-config
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
    version="1.2">
</faces-config>

 

hello11.xhtml:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Insert title here</title>
</head>

<body>

Hello static.

<br/>

Hello <h:outputText value="John"></h:outputText>

</body>

 

 

very simple code but for some reason the dynamic content <h:outputText value="John"> does not display at runtime.

 

Thanks.

Reply to this message by going to Community

Start a new discussion in JBoss Tools at Community