org.dellroad.stuff.servlet
Class OpenTransactionInViewFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
org.dellroad.stuff.servlet.OpenTransactionInViewFilter
- All Implemented Interfaces:
- Filter, BeanNameAware, DisposableBean, InitializingBean, ServletContextAware
public class OpenTransactionInViewFilter
- extends OncePerRequestFilter
Servlet filter that wraps execution in a transaction. A TransactionTemplate must exist in the
associated WebApplicationContext and is identified by name via setTransactionManagerBeanName() (by default, DEFAULT_TRANSACTION_MANAGER_BEAN_NAME).
Transaction properties are configurable via filter <init-param>'s isolation,
propagation, and readOnly.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_TRANSACTION_MANAGER_BEAN_NAME
public static final String DEFAULT_TRANSACTION_MANAGER_BEAN_NAME
- See Also:
- Constant Field Values
log
protected final Logger log
OpenTransactionInViewFilter
public OpenTransactionInViewFilter()
initFilterBean
protected void initFilterBean()
throws ServletException
- Overrides:
initFilterBean in class GenericFilterBean
- Throws:
ServletException
setIsolation
public void setIsolation(String isolation)
setPropagation
public void setPropagation(String propagation)
setReadOnly
public void setReadOnly(boolean readOnly)
setTransactionManagerBeanName
public void setTransactionManagerBeanName(String transactionManagerBeanName)
getTransactionManager
protected PlatformTransactionManager getTransactionManager()
doFilterInternal
protected void doFilterInternal(HttpServletRequest request,
HttpServletResponse response,
FilterChain filterChain)
throws ServletException,
IOException
- Specified by:
doFilterInternal in class OncePerRequestFilter
- Throws:
ServletException
IOException