关于hello1中的web.xml解析
在“Web页”节点下,展开WEB-INF节点,然后双击该web.xml文件以进行查看。
该web.xml文件包含Facelets应用程序所需的几个元素。使用NetBeans IDE创建应用程序时,将自动创建以下所有内容。
-
指定项目阶段的上下文参数:
<context-param> <param-name>javax.faces.PROJECT_STAGE</param-name> <param-value>Development</param-value> </context-param>上下文参数提供Web应用程序所需的配置信息。应用程序可以定义自己的上下文参数。此外,JavaServer Faces技术和Java Servlet技术定义了应用程序可以使用的上下文参数。
-
一个
servlet元素及其servlet-mapping元素指定FacesServlet。所有带.xhtml后缀的文件都将匹配:<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>*.xhtml</url-pattern> </servlet-mapping> -
一个
welcome-file-list元素指定着陆页的位置:<welcome-file-list> <welcome-file>index.xhtml</welcome-file> </welcome-file-list>

浙公网安备 33010602011771号