首页 > 编程语言 > 详细

SpringMvc的服务器端跳转和客户端跳转

时间:2017-02-26 12:08:10      阅读:254      评论:0      收藏:0      [点我收藏+]

首先,找到

package org.springframework.web.servlet.view;

public class InternalResourceViewResolver extends UrlBasedViewResolver

UrlBasedViewResolver这个类

 

/**
* Prefix for special view names that specify a redirect URL (usually
* to a controller after a form has been submitted and processed).
* Such view names will not be resolved in the configured default
* way but rather be treated as special shortcut.
*/
public static final String REDIRECT_URL_PREFIX = "redirect:";


/**
* Prefix for special view names that specify a forward URL (usually
* to a controller after a form has been submitted and processed).
* Such view names will not be resolved in the configured default
* way but rather be treated as special shortcut.
*/
public static final String FORWARD_URL_PREFIX = "forward:";

 

会有这俩个属性

 

默认情况下是服务器端跳转,在需要客户端跳转的时候加上“redirect:”即可

SpringMvc的服务器端跳转和客户端跳转

原文:http://www.cnblogs.com/soundcode/p/6443868.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!