Tabla de contenido
Diagrama de flujo cuando no hay una excepción global de SpringMVC
Diagrama de flujo de excepción global de SpringMVC
En realidad es un objeto modelandview
Archivo de configuración
ApplicationContext.xml
<? xml versión = "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://wwww.springframe xmlns: context = "http://www.springframework.org/schema/context" xmlns: tareas = "http://www.springframework.org/schema/Task" xsi: schemalocation = "http://www.springframework.org/schem http://www.springframework.org/schema/context 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.xsd Base-Package = "com.mmall"> <!-La responsabilidad de escanear el controlador se entrega al despachador-servlet.xml, así que excluir-> <context: excluir-filter type = "annotation" expresion = "org.springframework.steretype.controller"/> </context: component-scan> <aeP: aspectoj-autoproxy/-spril <context: Property-placeholder ubicación = "classpath: dataSource.properties"/> <tarea: annotation-driven/> <import resource = "applicationcontext-spring-session.xml"/> <importe resource = "applicationContext-Datasource.xml"/> </le beanS>
despachador-servlet.xml
<? xml versión = "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/spring-beans.xsd http://www.springframework.org/schema/context http://www.springfframework.org/context/spring-contexsdd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd "> <!-springmvc scan se especifica en el controlador para evitar escaneos repetidos-> <contexto: componente-scan-package =" " annotation-config = "true" use-default-filters = "false"> <context: include-Filter type = "anotation" expresion = "org.springframework.steretype.controller"/> </context: component-scan> <mvc: annotation-drivedriven> <mvc: message-conververter <LiC> <valor> Text/Plain; Charset = UTF-8 </value> <value> text/html; charset = utf-8 </value> </list> </property> </bean> <Bean> <Property name = "SoportedMediatypes"> <List> <LaPon> Application/Json; Charset = Utf-8 </value> </ List> </sperty> <//mvc. </mvc: annotation-driven> <mvc: interceptores> <!-definido aquí, todos ellos serán interceptados-> <mvc: interceptor> <!-administrar/a.do/gestionar/*-> <!-manager/b.do/gestionar/*-> <!-manager/producto/save.do/gestión/**-> <!-gestionar/orden/detalle <mvc: mapping path = "/manage/**"/> <!-<mvc: excluir-mapping path = "/manage/user/login.do"/>-> <bean/> </mvc: interceptor> </mvc: interceptores> </beans>
Resumir
Lo anterior es todo el contenido de este artículo. Espero que el contenido de este artículo tenga cierto valor de referencia para el estudio o el trabajo de todos. Si tiene alguna pregunta, puede dejar un mensaje para comunicarse. Gracias por su apoyo a Wulin.com.