jsf、Spring、Hibernate 集成 web.xml配置文件
2006-01-07 14:31
871 查看
<?xml version="1.0"?>
<!--
* Copyright 2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<!-- This web.xml can be used during debugging, when there is no myfaces.jar
library available.
The faces-config.xml file (that is normally in the myfaces.jar) must be
copied to the /WEB-INF directory of the web context.
The TLDs (that are normally in the myfaces.jar) must be
copied to the /WEB-INF/lib directory of the web context.-->
<display-name>PCManager Suite</display-name>
<description>PCManager Suite.</description>
<!-- JavaServer Faces -->
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>
/WEB-INF/xml/faces-config.xml,/WEB-INF/xml/faces-managed-beans.xml,/WEB-INF/xml/faces-navigation.xml
</param-value>
</context-param>
<context-param>
<!-- contextConfigLocation -->
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/xml/applicationContext-hibernate.xml
</param-value>
</context-param>
<!--
- Location of the Log4J config file, for initialization and refresh checks.
- Applied by Log4jConfigListener.
-->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log/log4j.properties</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
<param-value>true</param-value>
<description>
This parameter tells MyFaces if javascript code should be
allowed in the rendered HTML output. If javascript is
allowed, command_link anchors will have javascript code that
submits the corresponding form. If javascript is not
allowed, the state saving info and nested parameters will be
added as url parameters. Default: "true"
</description>
</context-param>
<context-param>
<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
<param-value>true</param-value>
<description>
If true, rendered HTML code will be formatted, so that it is
"human readable". i.e. additional line separators and
whitespace will be written, that do not influence the HTML
code. Default: "true"
</description>
</context-param>
<context-param>
<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
<param-value>true</param-value>
<description>
If true, a javascript function will be rendered that is able
to restore the former vertical scroll on every request.
Convenient feature if you have pages with long lists and you
do not want the browser page to always jump to the top if
you trigger a link or button action that stays on the same
page. Default: "false"
</description>
</context-param>
<!-- WelcomeFile Filter -->
<!--
<filter>
<filter-name>WelcomeFile Filter</filter-name>
<filter-class>org.apache.myfaces.webapp.filter.WelcomeFileFilter</filter-class>
<description>
Due to the manner in which the JSP / servlet lifecycle
functions, it is not currently possible to specify default
welcome files for a web application and map them to the
MyFacesServlet. Normally they will be mapped to the
default servlet for the JSP container. To offset this
shortcoming, we utilize a servlet Filter which examines
the URI of all incoming requests.
</description>
</filter>
-->
<!-- Extensions Filter -->
<filter>
<filter-name>SecurityFilter</filter-name>
<filter-class>
com.inphit.pms.web.system.SecurityFilter
</filter-class>
</filter>
<filter>
<filter-name>extensionsFilter</filter-name>
<filter-class>
org.apache.myfaces.component.html.util.ExtensionsFilter
</filter-class>
<init-param>
<param-name>uploadMaxFileSize</param-name>
<param-value>100m</param-value>
<description>
Set the size limit for uploaded files. Format: 10 - 10
bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
</description>
</init-param>
<init-param>
<param-name>uploadThresholdSize</param-name>
<param-value>100k</param-value>
<description>
Set the threshold size - files below this limit are
stored in memory, files above this limit are stored on
disk.
Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
</description>
</init-param>
<!--
<init-param>
<param-name>uploadRepositoryPath</param-name>
<param-value>/temp</param-value>
<description>Set the path where the intermediary files will be stored.
</description>
</init-param>-->
</filter>
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>SecurityFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>/faces/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>
org.apache.myfaces.webapp.StartupServletContextListener
</listener-class>
</listener>
<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- source code servlet (will not work with JSF virtual path mapping) -->
<!-- this servlet is optional and for educational purposes only -->
<servlet>
<servlet-name>SourceCodeServlet</servlet-name>
<servlet-class>
org.apache.myfaces.util.servlet.SourceCodeServlet
</servlet-class>
</servlet>
<servlet>
<servlet-name>SpringContextServlet</servlet-name>
<servlet-class>
org.springframework.web.context.ContextLoaderServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Faces Servlet Mapping -->
<!-- virtual path mapping -->
<!--
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
-->
<!-- extension mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SourceCodeServlet</servlet-name>
<url-pattern>*.source</url-pattern>
</servlet-mapping>
<!-- Welcome files
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
-->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
<!--
* Copyright 2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<!-- This web.xml can be used during debugging, when there is no myfaces.jar
library available.
The faces-config.xml file (that is normally in the myfaces.jar) must be
copied to the /WEB-INF directory of the web context.
The TLDs (that are normally in the myfaces.jar) must be
copied to the /WEB-INF/lib directory of the web context.-->
<display-name>PCManager Suite</display-name>
<description>PCManager Suite.</description>
<!-- JavaServer Faces -->
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>
/WEB-INF/xml/faces-config.xml,/WEB-INF/xml/faces-managed-beans.xml,/WEB-INF/xml/faces-navigation.xml
</param-value>
</context-param>
<context-param>
<!-- contextConfigLocation -->
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/xml/applicationContext-hibernate.xml
</param-value>
</context-param>
<!--
- Location of the Log4J config file, for initialization and refresh checks.
- Applied by Log4jConfigListener.
-->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log/log4j.properties</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
<param-value>true</param-value>
<description>
This parameter tells MyFaces if javascript code should be
allowed in the rendered HTML output. If javascript is
allowed, command_link anchors will have javascript code that
submits the corresponding form. If javascript is not
allowed, the state saving info and nested parameters will be
added as url parameters. Default: "true"
</description>
</context-param>
<context-param>
<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
<param-value>true</param-value>
<description>
If true, rendered HTML code will be formatted, so that it is
"human readable". i.e. additional line separators and
whitespace will be written, that do not influence the HTML
code. Default: "true"
</description>
</context-param>
<context-param>
<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
<param-value>true</param-value>
<description>
If true, a javascript function will be rendered that is able
to restore the former vertical scroll on every request.
Convenient feature if you have pages with long lists and you
do not want the browser page to always jump to the top if
you trigger a link or button action that stays on the same
page. Default: "false"
</description>
</context-param>
<!-- WelcomeFile Filter -->
<!--
<filter>
<filter-name>WelcomeFile Filter</filter-name>
<filter-class>org.apache.myfaces.webapp.filter.WelcomeFileFilter</filter-class>
<description>
Due to the manner in which the JSP / servlet lifecycle
functions, it is not currently possible to specify default
welcome files for a web application and map them to the
MyFacesServlet. Normally they will be mapped to the
default servlet for the JSP container. To offset this
shortcoming, we utilize a servlet Filter which examines
the URI of all incoming requests.
</description>
</filter>
-->
<!-- Extensions Filter -->
<filter>
<filter-name>SecurityFilter</filter-name>
<filter-class>
com.inphit.pms.web.system.SecurityFilter
</filter-class>
</filter>
<filter>
<filter-name>extensionsFilter</filter-name>
<filter-class>
org.apache.myfaces.component.html.util.ExtensionsFilter
</filter-class>
<init-param>
<param-name>uploadMaxFileSize</param-name>
<param-value>100m</param-value>
<description>
Set the size limit for uploaded files. Format: 10 - 10
bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
</description>
</init-param>
<init-param>
<param-name>uploadThresholdSize</param-name>
<param-value>100k</param-value>
<description>
Set the threshold size - files below this limit are
stored in memory, files above this limit are stored on
disk.
Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
</description>
</init-param>
<!--
<init-param>
<param-name>uploadRepositoryPath</param-name>
<param-value>/temp</param-value>
<description>Set the path where the intermediary files will be stored.
</description>
</init-param>-->
</filter>
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>SecurityFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>/faces/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>
org.apache.myfaces.webapp.StartupServletContextListener
</listener-class>
</listener>
<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- source code servlet (will not work with JSF virtual path mapping) -->
<!-- this servlet is optional and for educational purposes only -->
<servlet>
<servlet-name>SourceCodeServlet</servlet-name>
<servlet-class>
org.apache.myfaces.util.servlet.SourceCodeServlet
</servlet-class>
</servlet>
<servlet>
<servlet-name>SpringContextServlet</servlet-name>
<servlet-class>
org.springframework.web.context.ContextLoaderServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Faces Servlet Mapping -->
<!-- virtual path mapping -->
<!--
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
-->
<!-- extension mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SourceCodeServlet</servlet-name>
<url-pattern>*.source</url-pattern>
</servlet-mapping>
<!-- Welcome files
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
-->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
相关文章推荐
- spring配置文件的一般写法(集成hibernate) (applicationContext.xml)
- SSH开发环境的配置:web.xml、Spring集成hibernate和Spring集成Struts2
- jsf、Spring、Hibernate 集成 faces-managed-beans.xml 配置
- jsf、Spring、Hibernate 集成 applicationContext-hibernate.xml 配置
- Spring整合Hibernate的XML文件配置,以及web.xml文件配置
- spring与hibernate集成--spring配置文件applicationContext.xml的配置:
- web.xml集成Spring,Struts配置文件说明
- ssh整合!Struts.xml、hibernate与spring整合的applicationContext.xml、web.xml文件的配置!
- 通过web.xml中的监听器加载spring配置文件
- 基于注解的Struts2+Spring2.5+Hibernate3.3的Spring 配置文件,struts配置文件,web.xml配置文件的例子
- JavaEE 下面使用Spring 时 web.xml 中ContextLoaderListener的作用及配置,多个配置文件时contextConfigLocation的作用
- web.xml 文件中一般包括 servlet, spring, filter, listenr的配置。那么他们是按照一个什么顺序加载呢?
- WEB开发框架配置文件和各层注解(SpringMVC + Spring + Hibernate)
- spring与servlet3.0无web.xml文件时的配置方式
- Spring和Struts2配置文件不在默认路径下的web.xml配置方法
- Spring --web工程下xml配置文件部署
- spring的配置文件在web.xml中加载的方式
- Spring整合Hibernate配置(使用hibernate.cfg.xml文件)
- Spring中,applicationContext.xml 配置文件在web.xml中的配置详解
- 多个spring配置文件时在web.xml中的写法