首先,找到
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:”即可