org.shept.org.springframework.web.servlet.mvc.formcache
Class ReplacementSessionFormCache

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.shept.org.springframework.web.servlet.mvc.formcache.SimpleSessionFormCache
              extended by org.shept.org.springframework.web.servlet.mvc.formcache.ReplacementSessionFormCache
All Implemented Interfaces:
SessionFormCache, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware

public class ReplacementSessionFormCache
extends SimpleSessionFormCache

This Cache emulates the way that the AbstractFormController handled form caching. The org.shept.org.springframework.web.servlet.mvc.classic.AbstractFormController handled form caching by saving just the current form in the session. The form was removed from the session when obtaining the command object. When the workflow through the Controller completed, org.shept.org.springframework.web.servlet.mvc.classic.AbstractFormController#showForm exposed the form again to the session. This was a somewhat inflexible design. It makes sparse use of session memory but this was hardcoded and it didn't allow for a configurable stategy where session memory resources are not a bottleneck.

Version:
$$Id: ReplacementSessionFormCache.java 34 2010-08-20 16:46:49Z aha $$
Author:
Andi

Field Summary
private  boolean keepForms
           
 
Fields inherited from class org.shept.org.springframework.web.servlet.mvc.formcache.SimpleSessionFormCache
MAX_CACHE_SIZE, SESSION_FORM_CACHE_ATTIRBUTE
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
ReplacementSessionFormCache()
           
 
Method Summary
 Object getForm(javax.servlet.http.HttpServletRequest request, String formAttrName)
           
 boolean isKeepForms()
           
 void setKeepForms(boolean keepForms)
           
 
Methods inherited from class org.shept.org.springframework.web.servlet.mvc.formcache.SimpleSessionFormCache
clearCache, clearForm, clearOtherForms, getFormCache, getLastModified, getMaxCacheSize, saveForm, setMaxCacheSize
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, 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
 

Field Detail

keepForms

private boolean keepForms
Constructor Detail

ReplacementSessionFormCache

public ReplacementSessionFormCache()
Method Detail

getForm

public Object getForm(javax.servlet.http.HttpServletRequest request,
                      String formAttrName)
Specified by:
getForm in interface SessionFormCache
Overrides:
getForm in class SimpleSessionFormCache

isKeepForms

public boolean isKeepForms()

setKeepForms

public void setKeepForms(boolean keepForms)


Copyright © 2011. All Rights Reserved.