- <?xml version="1.0" encoding="UTF-8"?>
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:p="http://www.springframework.org/schema/p"
- xmlns:mvc="http://www.springframework.org/schema/mvc"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/aop
- http://www.springframework.org/schema/aop/spring-aop.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx.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
- ">
- <!--视图解析器-->
- <!--<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
- <property name="suffix" value=".jsp"></property>
- </bean>-->
- <!--视图 解析器-->
- <bean class="org.springframework.web.servlet.view.BeanNameViewResolver"/>
- <!--内部 视图-->
- <bean id="innter" class="org.springframework.web.servlet.view.JstlView">
- <property name="url" value="/index2.jsp"></property>
- </bean>
- <!--外部 视图-->
- <bean id="jd" class="org.springframework.web.servlet.view.RedirectView">
- <property name="url" value="https://www.jd.com/"></property>
- </bean>
- <!--属性解析器-->
- <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
- <property name="urlMap">
- <map>
- <entry key="/hello.do" value="multfist"></entry>
- </map>
- </property>
- </bean>
- <!--属性名称解析器-->
- <bean id="propertName" class="org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver">
- <property name="mappings">
- <props>
- <prop key="/fist.do">insert</prop>
- <prop key="/secord.do">delete</prop>
- </props>
- </property>
- </bean>
- <!--参数 属性名称 解析器 默认为 action-->
- <bean id="parameterMethodNameResolver" class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver">
- <!-- <property name="paramName" value="actionName"></property>-->
- </bean>
- <bean id="multfist" class="cn.hello.Conteller.MyView">
- <property name="methodNameResolver" ref="parameterMethodNameResolver"> </property>
- </bean>
- </beans>
spring mvc 内外部视图
最新推荐文章于 2025-04-01 15:09:45 发布