SpringMVC 内外部视图
来源:互联网 发布:编写c语言的步骤 编辑:程序博客网 时间:2024/06/06 06:38
<?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>
public class MyView extends MultiActionController { public ModelAndView insert(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception { ModelAndView mv=new ModelAndView(); mv.setViewName("jd"); return mv; }}
阅读全文
0 0
- SpringMVC 内外部视图
- SpringMVC 内外部视图
- spring mvc 内外部视图
- SpringMVC-视图
- springmvc视图
- 内外部存储大小
- 内外部参数
- 内部类 外部类
- 创建内外部文件
- jquery内外部插入
- 内部类、外部类
- SpringMVC视图中的tiles视图
- springmvc多视图映射
- SpringMVC视图解析器
- SpringMVC视图解析器
- SpringMVC视图解析器
- SpringMVC视图解析器
- SpringMVC视图解析器
- java数据类型
- 数模培训记录
- SpringMVC 第二种 方式例子
- Spring和MyBatis的整合的查询小案例
- SpringMVC 解析器
- SpringMVC 内外部视图
- Python基础07 函数
- Javascript—if...else语句
- Spring静态页面无法访问解决方案
- vim快捷键整理大全
- 【poj-2406-powerstring】(KMP)
- spring配置数据源的四种方式
- HandlerMapping和BeanNameUrlHandlerMapping的使用
- SpringMVC 注解