App-HelloWorld



創建一個新 Dynamic Web Project

指定選用的 Application Server

預設 Servlet 版本為 2.5, (將來要換成 JEE6, Servlet 3.0)


index.html

增加該 Project 到 AP Server Container and running server.

add 'index.html' file, and write to string "Hello, World !" in WebContent.

Republish this project.

see http://127.0.0.1:8080/KuoChaoYi/index.html



JSF

增加該 Project 對 JSR 299 WebBeans 1.0 的 RI

add XHTML strict type file: 'hello.xhtml'

see http://127.0.0.1:8080/KuoChaoYi/hello.xhtml (xmlns)
xmlns:h="http://java.sun.com/jsf/html

Modified /WebContent/web.xml, add JSF Engine & url mapping.
    <servlet>
        <servlet-name>JSF</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>JSF</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>


add /WebContent/faces-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<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_2_0.xsd"
    version="2.0">
</faces-config>

Comments