Test-servlet

<?xml version="1.0" encoding="UTF-8"?>
<beans
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-2.5.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">  
   
    <description>Spring-DispatcherServlet需要的配置</description>
   
<!-- Mapping exception to the handler view
<bean id="exceptionResolover"
  class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
  <property name="defaultErrorView">
  <value>/common/error/error</value>
  </property>
  <property name="exceptionMappings">
  <props>
  <prop key="com.ccc.exception.BusinessException">/common/error/businessError</prop>
  <prop key="java.sql.SQLException">/common/error/error</prop>
  <prop key="java.lang.RuntimeExcption">/common/error/error</prop>
  </props>
  </property>
</bean>
-->
<!-- 对模型视图名称的解析,即在模型视图名称添加前后缀 -->
    <bean id="jstlViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/"/>
<property name="suffix" value=".jsp"/>
</bean>
<bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"> 
        <property name="order" value="2" /> 
    </bean> 

<bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="cookieName">
<value>mes_locale</value>
</property>
<property name="cookieMaxAge">
<value>31536000</value>
</property>
</bean>

</beans>

猜你喜欢

转载自cyanicbird.iteye.com/blog/1186371