类 RedirectViewControllerRegistration
- java.lang.Object
- org.springframework.web.servlet.config.annotation.RedirectViewControllerRegistration
public class RedirectViewControllerRegistration extends Object
Assist with the registration of a single redirect view controller.- 从以下版本开始:
- 4.1
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 RedirectViewControllerRegistration(String urlPath, String redirectUrl)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected String
getUrlPath()
protected ParameterizableViewController
getViewController()
protected void
setApplicationContext(ApplicationContext applicationContext)
RedirectViewControllerRegistration
setContextRelative(boolean contextRelative)
Whether to interpret a given redirect URL that starts with a slash ("/") as relative to the current ServletContext, i.e. as relative to the web application root.RedirectViewControllerRegistration
setKeepQueryParams(boolean propagate)
Whether to propagate the query parameters of the current request through to the target redirect URL.RedirectViewControllerRegistration
setStatusCode(HttpStatus statusCode)
Set the specific redirect 3xx status code to use.
构造器详细资料
RedirectViewControllerRegistration
public RedirectViewControllerRegistration(String urlPath, String redirectUrl)
方法详细资料
setStatusCode
public RedirectViewControllerRegistration setStatusCode(HttpStatus statusCode)
Set the specific redirect 3xx status code to use.If not set,
RedirectView
will selectHttpStatus.MOVED_TEMPORARILY (302)
by default.
setContextRelative
public RedirectViewControllerRegistration setContextRelative(boolean contextRelative)
Whether to interpret a given redirect URL that starts with a slash ("/") as relative to the current ServletContext, i.e. as relative to the web application root.Default is
true
.
setKeepQueryParams
public RedirectViewControllerRegistration setKeepQueryParams(boolean propagate)
Whether to propagate the query parameters of the current request through to the target redirect URL.Default is
false
.
setApplicationContext
protected void setApplicationContext(ApplicationContext applicationContext)
getUrlPath
protected String getUrlPath()
getViewController
protected ParameterizableViewController getViewController()