方枪枪的java世界

不要因为风雨飘落就停止了你的脚步,真正的得失就在你的心中。 做喜欢做的事,不轻言放弃!

02 整合spring3和mybatis进行web开发之web_xml(使用了spring_security)

<?xml version="1.0" encoding="UTF-8"?>
<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"
 version="2.5">

 <display-name>Tianhe Framework Example Application</display-name>

 <!--  -->
 <context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>
   classpath:META-INF/spring/global.common.xml  
   classpath:META-INF/spring/global.datasource.xml
   classpath:META-INF/spring/global.security.xml  
  </param-value>
 </context-param>

 <context-param>
  <param-name>webAppRootKey</param-name>
  <param-value>example</param-value>
 </context-param>

 <context-param>
  <param-name>log4jConfigLocation</param-name>
  <param-value>classpath:/log4j.properties</param-value>
 </context-param>

 <context-param>
  <param-name>log4jRefreshInterval</param-name>
  <param-value>60000</param-value>
 </context-param>

 <listener>
  <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
 </listener>

 <listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
 </listener>

 <listener>
  <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
 </listener>

 <filter>
  <filter-name>characterEncodingFilter</filter-name>
  <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  <init-param>
   <param-name>encoding</param-name>
   <param-value>UTF-8</param-value>
  </init-param>
  <init-param>
   <param-name>forceEncoding</param-name>
   <param-value>true</param-value>
  </init-param>
 </filter>
 <filter-mapping>
  <filter-name>characterEncodingFilter</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>

 <filter>
  <filter-name>CommonWebFilter</filter-name>
  <filter-class>com.tianhe.frm.web.CommonWebFilter</filter-class>
  <init-param>
   <param-name>interceptors</param-name>
   <param-value>com.tianhe.frm.web.WebContextFilterInterceptor</param-value>
  </init-param>
 </filter>
 <filter-mapping>
  <filter-name>CommonWebFilter</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>

 <filter>
  <filter-name>securityFilter</filter-name>
  <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
  <init-param>
   <param-name>targetBeanName</param-name>
   <param-value>springSecurityFilterChain</param-value>
  </init-param>
 </filter>
 <filter-mapping>
  <filter-name>securityFilter</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>

 <servlet>
  <servlet-name>dispatcher</servlet-name>
  <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  <init-param>
   <param-name>contextConfigLocation</param-name>
   <param-value>/WEB-INF/dispatcher-servlet.xml</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>
 </servlet>
 <servlet-mapping>
  <servlet-name>dispatcher</servlet-name>
  <url-pattern>*.do</url-pattern>
 </servlet-mapping>

 <!--
  <servlet> <servlet-name>remoting</servlet-name>
  <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping>
  <servlet-name>remoting</servlet-name>
  <url-pattern>/httpinvoker/*</url-pattern> </servlet-mapping>
  <servlet-mapping> <servlet-name>remoting</servlet-name>
  <url-pattern>/burlap/*</url-pattern> </servlet-mapping>
  <servlet-mapping> <servlet-name>remoting</servlet-name>
  <url-pattern>/hessian/*</url-pattern> </servlet-mapping>
 -->

 <mime-mapping>
  <extension>doc</extension>
  <mime-type>application/msword</mime-type>
 </mime-mapping>
 <mime-mapping>
  <extension>xls</extension>
  <mime-type>application/vnd.ms-excel</mime-type>
 </mime-mapping>
 <mime-mapping>
  <extension>ppt</extension>
  <mime-type>application/vnd.ms-powerpoint</mime-type>
 </mime-mapping>
 <mime-mapping>
  <extension>zip</extension>
  <mime-type>application/zip</mime-type>
 </mime-mapping>
 <mime-mapping>
  <extension>rar</extension>
  <mime-type>application/rar</mime-type>
 </mime-mapping>
 <mime-mapping>
  <extension>pdf</extension>
  <mime-type>application/pdf</mime-type>
 </mime-mapping>
 <mime-mapping>
  <extension>txt</extension>
  <mime-type>application/txt</mime-type>
 </mime-mapping>
 <mime-mapping>
  <extension>chm</extension>
  <mime-type>application/mshelp</mime-type>
 </mime-mapping>
 <mime-mapping>
  <extension>mp3</extension>
  <mime-type>audio/x-mpeg</mime-type>
 </mime-mapping>

 <error-page>
  <error-code>400</error-code>
  <location>/error.jsp</location>
 </error-page>
 <error-page>
  <error-code>401</error-code>
  <location>/error.jsp</location>
 </error-page>
 <error-page>
  <error-code>402</error-code>
  <location>/error.jsp</location>
 </error-page>
 <error-page>
  <error-code>403</error-code>
  <location>/error.jsp</location>
 </error-page>
 <error-page>
  <error-code>404</error-code>
  <location>/error.jsp</location>
 </error-page>
 <error-page>
  <error-code>405</error-code>
  <location>/error.jsp</location>
 </error-page>
 <error-page>
  <error-code>406</error-code>
  <location>/error.jsp</location>
 </error-page>
 <error-page>
  <error-code>407</error-code>
  <location>/error.jsp</location>
 </error-page>
 <error-page>
  <error-code>413</error-code>
  <location>/error.jsp</location>
 </error-page>
 <error-page>
  <error-code>414</error-code>
  <location>/error.jsp</location>
 </error-page>
 <error-page>
  <error-code>500</error-code>
  <location>/error.jsp</location>
 </error-page>
 <error-page>
  <error-type>javax.lang.Exception</error-type>
  <location>/error/jsp/errorException.jsp</location>
 </error-page>

 <welcome-file-list>
  <welcome-file>index.jsp</welcome-file>
 </welcome-file-list>

 <session-config>
  <session-timeout>10</session-timeout>
 </session-config>

 <!--
  <jsp-config> <jsp-property-group> <url-pattern>*.jsp</url-pattern>
  <el-ignored>true</el-ignored> </jsp-property-group> </jsp-config>
 -->

</web-app>

posted on 2012-07-07 14:56 做强大的自己 阅读(765) 评论(0)  编辑  收藏 所属分类: Spring


只有注册用户登录后才能发表评论。


网站导航: