javascript
SpringMvc的服务器端跳转和客户端跳转
首先,找到
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的服务器端跳转和客户端跳转的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: springMvc的一些简介 和基于xm
- 下一篇: 岱字起名男孩(宝岛之名,为男孩取个好名字