public class OpenTransactionInViewFilter extends OncePerRequestFilter
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.
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_TRANSACTION_MANAGER_BEAN_NAME |
protected Logger |
log |
ALREADY_FILTERED_SUFFIXlogger| Constructor and Description |
|---|
OpenTransactionInViewFilter() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doFilterInternal(HttpServletRequest request,
HttpServletResponse response,
FilterChain filterChain) |
protected PlatformTransactionManager |
getTransactionManager() |
protected void |
initFilterBean() |
void |
setIsolation(String isolation) |
void |
setPropagation(String propagation) |
void |
setReadOnly(boolean readOnly) |
void |
setTransactionManagerBeanName(String transactionManagerBeanName) |
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatchaddRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, setBeanName, setEnvironment, setServletContextpublic static final String DEFAULT_TRANSACTION_MANAGER_BEAN_NAME
protected final Logger log
protected void initFilterBean()
throws ServletException
initFilterBean in class GenericFilterBeanServletExceptionpublic void setIsolation(String isolation)
public void setPropagation(String propagation)
public void setReadOnly(boolean readOnly)
public void setTransactionManagerBeanName(String transactionManagerBeanName)
protected PlatformTransactionManager getTransactionManager()
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException
doFilterInternal in class OncePerRequestFilterServletExceptionIOExceptionCopyright © 2020. All rights reserved.