com.interface21.web.servlet.view
Class RedirectView
java.lang.Object
|
+--com.interface21.context.support.ApplicationObjectSupport
|
+--com.interface21.web.servlet.view.AbstractView
|
+--com.interface21.web.servlet.view.RedirectView
- All Implemented Interfaces:
- ApplicationContextAware, View
- public class RedirectView
- extends AbstractView
View that redirects to an internal or external URL,
exposing all model attributes as HTTP query parameters.
- Version:
- $Revision: 1.4 $
- Author:
- Rod Johnson, Juergen Hoeller
|
Method Summary |
protected java.lang.String |
getUrl()
|
protected java.util.Map |
queryProperties(java.util.Map model)
Subclasses can override this method to return name-value pairs for query strings,
which will be URLEncoded and formatted by this class.
|
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 url. |
void |
setUrl(java.lang.String url)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RedirectView
public RedirectView()
RedirectView
public RedirectView(java.lang.String url)
setUrl
public void setUrl(java.lang.String url)
getUrl
protected java.lang.String getUrl()
queryProperties
protected java.util.Map queryProperties(java.util.Map model)
- Subclasses can override this method to return name-value pairs for query strings,
which will be URLEncoded and formatted by this class.
This implementation tries to stringify all model elements.
renderMergedOutputModel
protected void renderMergedOutputModel(java.util.Map model,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException,
javax.servlet.ServletException
- Convert model to request parameters and redirect to url.
- Overrides:
renderMergedOutputModel in class AbstractView
- Following copied from class:
com.interface21.web.servlet.view.AbstractView
- Parameters:
model - combined output Map, with dynamic values
taking precedence over static attributesrequest - current HTTP requestresponse - current HTTP response- Throws:
java.io.IOException - if there is an IO exception trying to obtain
or render the viewjavax.servlet.ServletException - if there is any other error
Rod Johnson and Spring contributors 2001-2003.