Spring MVC 전역 이상 실례 상세 설명

목차

SpringMVC 전역 이상 없 을 때의 흐름 도

SpringMVC 전역 이상 흐름 도

사실 모델 앤 드 뷰 대상 이에 요.
프로필
applicationcontext.xml

<?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:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:context="http://www.springframework.org/schema/context" xmlns:task="http://www.springframework.org/schema/task"  xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
  http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
  http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd">
 <context:component-scan base-package="com.mmall">
  <!--   controller     dispatcher-servlet.xml,     -->
  <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
 </context:component-scan>
 <aop:aspectj-autoproxy/>
 <!-- spring schedule -->
 <context:property-placeholder location="classpath:datasource.properties"/>
 <task:annotation-driven/>
 <import resource="applicationContext-spring-session.xml"/>
 <import resource="applicationContext-datasource.xml"/>
</beans>
dispacher-servlet.xml

<?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:mvc="http://www.springframework.org/schema/mvc"xmlns:aop="http://www.springframework.org/schema/aop"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
 http://www.springframework.org/schema/mvc
 http://www.springframework.org/schema/mvc/spring-mvc.xsd">
 <!-- springmvc      controller,       -->
 <context:component-scan base-package="com.mmall.controller" annotation-config="true" use-default-filters="false">
  <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
 </context:component-scan>
 <mvc:annotation-driven>
  <mvc:message-converters>
   <bean class="org.springframework.http.converter.StringHttpMessageConverter">
    <property name="supportedMediaTypes">
     <list>
<value>text/plain;charset=UTF-8</value>
      <value>text/html;charset=UTF-8</value>
     </list>
    </property>
   </bean>
   <bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
    <property name="supportedMediaTypes">
     <list>
      <value>application/json;charset=UTF-8</value>
     </list>
    </property>
   </bean>
  </mvc:message-converters>
 </mvc:annotation-driven>
 <mvc:interceptors>
  <!--       ,       -->
  <mvc:interceptor>
   <!--manage/a.do /manage/*-->
   <!--manage/b.do /manage/*-->
   <!--manage/product/save.do /manage/**-->
   <!--manage/order/detail.do /manage/**-->
   <mvc:mapping path="/manage/**"/>
   <!--<mvc:exclude-mapping path="/manage/user/login.do"/>-->
   <bean class="com.mmall.controller.common.interceptor.AuthorityInterceptor" />
  </mvc:interceptor>
 </mvc:interceptors>
</beans>
총결산
이상 은 이 글 의 전체 내용 입 니 다.본 논문 의 내용 이 여러분 의 학습 이나 업무 에 어느 정도 참고 학습 가치 가 있 기 를 바 랍 니 다.궁금 한 점 이 있 으 시 면 댓 글 을 남 겨 주 셔 서 저희 에 대한 지지 에 감 사 드 립 니 다.

좋은 웹페이지 즐겨찾기