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

Fields inherited from class com.interface21.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
RedirectView()
           
RedirectView(java.lang.String url)
           
 
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 com.interface21.web.servlet.view.AbstractView
addStaticAttribute, getContentType, getName, getStaticAttributes, render, setAttributes, setAttributesCSV, setContentType, setName, setRequestContextAttribute
 
Methods inherited from class com.interface21.context.support.ApplicationObjectSupport
getApplicationContext, initApplicationContext, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RedirectView

public RedirectView()

RedirectView

public RedirectView(java.lang.String url)
Method Detail

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 attributes
request - current HTTP request
response - current HTTP response
Throws:
java.io.IOException - if there is an IO exception trying to obtain or render the view
javax.servlet.ServletException - if there is any other error


Rod Johnson and Spring contributors 2001-2003.