net.sourceforge.xconf.toolbox.spring.mvc
Class ReadOnlyGetController

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.springframework.web.servlet.support.WebContentGenerator
              extended by net.sourceforge.xconf.toolbox.spring.mvc.AbstractGetController
                  extended by net.sourceforge.xconf.toolbox.spring.mvc.ReadOnlyGetController
All Implemented Interfaces:
ApplicationContextAware, ServletContextAware, Controller

public abstract class ReadOnlyGetController
extends AbstractGetController

Controller that handles HTTP GET requests and ensures that any database transaction used to prepare the ModelAndView for rendering is rolled back, so that GETs have no effect on persistent state.


Field Summary
 
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
ReadOnlyGetController()
           
 
Method Summary
protected  ModelAndView handleGet(HttpServletRequest request, HttpServletResponse response)
          Executes handleReadOnlyGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) in a transactional block where any changes to the database are rolled-back.
protected abstract  ModelAndView handleReadOnlyGet(HttpServletRequest request, HttpServletResponse response)
          Handle a read-only HTTP GET request.
 void setTransactionTemplate(TransactionOperations transactionTemplate)
           
 
Methods inherited from class net.sourceforge.xconf.toolbox.spring.mvc.AbstractGetController
handleRequest
 
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseExpiresHeader
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, isContextRequired, setServletContext
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadOnlyGetController

public ReadOnlyGetController()
Method Detail

setTransactionTemplate

public void setTransactionTemplate(TransactionOperations transactionTemplate)

handleGet

protected final ModelAndView handleGet(HttpServletRequest request,
                                       HttpServletResponse response)
                                throws Exception
Executes handleReadOnlyGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) in a transactional block where any changes to the database are rolled-back.

Specified by:
handleGet in class AbstractGetController
Throws:
Exception

handleReadOnlyGet

protected abstract ModelAndView handleReadOnlyGet(HttpServletRequest request,
                                                  HttpServletResponse response)
                                           throws Exception
Handle a read-only HTTP GET request.

Throws:
Exception


Copyright © 2007 Thomas Czarniecki. All Rights Reserved.