1.说明

  可以直接相应转发的页面, 而无需再经过 Handler 的方法.

  这个时候可以使用mvc:view-controller标签。

  但是以前的映射会出现问题,这个时候需要再配置一个标签<mvc:annotation-driven></mvc:annotation-driven>

2.程序

  注意点:需要在头上添加mvc

 <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<!-- 配置自定义扫描的包 -->
<context:component-scan base-package="com.spring.it" ></context:component-scan> <!-- 配置视图解析器 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/" />
<property name="suffix" value=".jsp" />
</bean> <!-- 配置国际化资源文件 -->
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename" value="i18n"></property>
</bean> <!-- 配置直接转发的页面 -->
<!-- 可以直接相应转发的页面, 而无需再经过 Handler 的方法. -->
<mvc:view-controller path="/success" view-name="success"/> <!-- 在实际开发中通常都需配置 mvc:annotation-driven 标签 -->
<mvc:annotation-driven></mvc:annotation-driven>
</beans>

3.可以直接使用

  http://localhost:8080/HelloworldMVC/success

  

014 view-controller标签的更多相关文章

  1. View Controller Programming Guide for iOS---(七)---Resizing the View Controller’s Views

    Resizing the View Controller’s Views A view controller owns its own view and manages the view’s cont ...

  2. View Controller Programming Guide for iOS---(四)---Creating Custom Content View Controllers

    Creating Custom Content View Controllers 创建自定义内容视图控制器 Custom content view controllers are the heart ...

  3. View Controller Programming Guide for iOS---(二)---View Controller Basics

    View Controller Basics Apps running on iOS–based devices have a limited amount of screen space for d ...

  4. iOS 因为reason: 'Pushing the same view controller instance more than once is not supported而奔溃(下)

    这个问题是什么意思呢,之前遇到过几次,但程序再次打开时没有问题,也就没有重视,今天又遇到了,无法忍受啊. 控制台报的错误是:"不支持多次推入相同的视图控制器实例". 什么原因造成的 ...

  5. 报错:Failed to instantiate the default view controller for UIMainStoryboardFile 'MainStoryboard' - perhaps the designated entry point is not set?

    原因分析:在StoryBoard中没有一个view controller设置了Initial Scene. 解决方案:在Storyboard中,选择一个view conroller作为story bo ...

  6. iOS架构师之路:控制器(View Controller)瘦身设计

    前言 古老的MVC架构是容易被iOS开发者理解和接受的设计模式,但是由于iOS开发的项目功能越来越负责庞大,项目代码也随之不断壮大,MVC的模糊定义导致我们的业务开发工程师很容易把大量的代码写到视图控 ...

  7. View Controller Relationships

    Parent-child relationshipsParent-child relationships are formed when using view controller container ...

  8. Model View Controller

    On the iPhone or iPod touch, a modal view controller takes over the entire screen. This is the defau ...

  9. UISearchController Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior

    Attempting to load the view of a view controller while it is deallocating is not allowed and may res ...

  10. Application tried to present a nil modal view controller on target “Current View Controller”解决方案

    情景再现 1,自定义一个storyboard: 打开xcode,按下cmd+N,新建一个Storyboard--->next 将新建立的storyboard命名为:TestViewControl ...

随机推荐

  1. 标签页QTabWidget

    样式: import sys from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QApplication, QWidget, QTab ...

  2. python技巧 一等函数

    函数在python中作为一等函数,具有以下特点: 1.可以作为参数传递给其他函数 2.作为其他函数的值返回 3.能赋值给变量或数据结构中的元素 4.在运行的时候创建 In [1]: def add(x ...

  3. 第16月第26天 /bin/bash^M: bad interpreter: 没有那个文件或目录

    1. 运行脚本时出现了这样一个错误,打开之后并没有找到所谓的^M,查了之后才知道原来是文件格式的问题,也就是linux和windows之间的不完全兼容...具体细节不管,如果验证: vim test. ...

  4. linux下比较两个文本文件的不同——diff命令

    1>Diff命令的功能Linux中Diff命令的功能为逐行比较两个文本文件,列出其不同之处.它对给出的文件进行系统的检查,并显示出两个文件中所有不同的行,不要求事先对文件进行排序. 2>语 ...

  5. CSS font-family 各名称一览表

    参考链接:https://blog.csdn.net/cddcj/article/details/70739481

  6. java中String类型

    string对象常用方法 string对象比较方法: string类获取包含子串的方法: 字符串和数字的转换: String类 String对象是不可改变的,字符串一旦创建,内容不能再改变. 构造字符 ...

  7. android aysncTask面试解析

  8. 用C++的 new 代替 C 的 malloc 进行内存分配

    例子: (int*)malloc(100*sizeof(int)) 是先取得int类型的字节宽度,然后乘100计算后得到400,然后调用malloc,并将400传递给函数,分配400字节的内存空间,但 ...

  9. OpenCV:Debug和Release模式 && 静态和动态编译

    1.Release和Debug的区别 Release版称为发行版,Debug版称为调试版. Debug中可以单步执行.跟踪等功能,但生成的可执行文件比较大,代码运行速度较慢.Release版运行速度较 ...

  10. C语言表驱动法编程实践

    数据压倒一切.如果选择了正确的数据结构并把一切组织的井井有条,正确的算法就不言自明.编程的核心是数据结构,而不是算法. ——Rob Pike  说明 本文基于这样的认识:数据是易变的,逻辑是稳定的. ...