|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.context.support.ApplicationObjectSupport org.springframework.web.context.support.WebApplicationObjectSupport org.springframework.web.servlet.view.AbstractView org.springframework.web.servlet.view.AbstractUrlBasedView org.springframework.web.servlet.view.RedirectView
View that redirects to an internal or external URL, exposing all model attributes as HTTP query parameters.
A URL for this view is supposed to be a HTTP redirect URL, i.e. suitable for HttpServletResponse's sendRedirect method.
HttpServletResponse.sendRedirect(java.lang.String)
Field Summary | |
static java.lang.String |
DEFAULT_ENCODING_SCHEME
|
Fields inherited from class org.springframework.web.servlet.view.AbstractView |
DEFAULT_CONTENT_TYPE |
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
logger |
Constructor Summary | |
RedirectView()
Constructor for use as a bean. |
|
RedirectView(java.lang.String url)
Create a new RedirectView with the given URL. |
|
RedirectView(java.lang.String url,
boolean contextRelative)
Create a new RedirectView with the given URL. |
Method Summary | |
protected void |
appendQueryProperties(java.lang.StringBuffer targetUrl,
java.util.Map model,
java.lang.String encodingScheme)
Append query properties to the redirect URL. |
protected java.util.Map |
queryProperties(java.util.Map model)
Determine name-value pairs for query strings, which will be stringified, URL-encoded and formatted by buildRedirectUrl. |
protected void |
renderMergedOutputModel(java.util.Map model,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Convert model to request parameters and redirect to the given URL. |
void |
setContextRelative(boolean contextRelative)
Set whether to interpret the given URL as relative to the current ServletContext, i.e. as relative to the web application root. |
void |
setEncodingScheme(java.lang.String encodingScheme)
Set the encoding scheme for this view. |
Methods inherited from class org.springframework.web.servlet.view.AbstractUrlBasedView |
getUrl, initApplicationContext, setUrl |
Methods inherited from class org.springframework.web.servlet.view.AbstractView |
addStaticAttribute, getBeanName, getContentType, getStaticAttributes, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setRequestContextAttribute |
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
getServletContext, getTempDir, getWebApplicationContext |
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_ENCODING_SCHEME
Constructor Detail |
public RedirectView()
public RedirectView(java.lang.String url)
url
- the URL to redirect topublic RedirectView(java.lang.String url, boolean contextRelative)
url
- the URL to redirect tocontextRelative
- whether to interpret the given URL as
relative to the current ServletContextMethod Detail |
public void setContextRelative(boolean contextRelative)
Default is false: The URL will be intepreted as absolute, i.e. taken as-is. If true, the context path will be prepended to the URL.
HttpServletRequest.getContextPath()
public void setEncodingScheme(java.lang.String encodingScheme)
protected void renderMergedOutputModel(java.util.Map model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
renderMergedOutputModel
in class AbstractView
model
- combined output Map, with dynamic values taking
precedence over static attributesrequest
- current HTTP requestresponse
- current HTTP response
java.io.IOException
appendQueryProperties(java.lang.StringBuffer, java.util.Map, java.lang.String)
protected void appendQueryProperties(java.lang.StringBuffer targetUrl, java.util.Map model, java.lang.String encodingScheme) throws java.io.UnsupportedEncodingException
targetUrl
- the StringBuffer to append the properties tomodel
- Map that contains model attributesencodingScheme
- the encoding scheme to use
java.io.UnsupportedEncodingException
- if string encoding failedqueryProperties(java.util.Map)
protected java.util.Map queryProperties(java.util.Map model)
This implementation returns all model elements as-is.
appendQueryProperties(java.lang.StringBuffer, java.util.Map, java.lang.String)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |