public class TokenSessionStoreInterceptor extends TokenInterceptor
This interceptor builds off of the TokenInterceptor, providing advanced logic for handling invalid tokens.
Unlike the normal token interceptor, this interceptor will attempt to provide intelligent fail-over in the event of
multiple requests using the same session. That is, it will block subsequent requests until the first request is
complete, and then instead of returning the invalid.token code, it will attempt to display the same response
that the original, valid action invocation would have displayed if no multiple requests were submitted in the first
place.
NOTE: As this method extends off MethodFilterInterceptor, it is capable of
deciding if it is applicable only to selective methods in the action class. See
MethodFilterInterceptor for more info.
Interceptor parameters:
Extending the interceptor:
There are no known extension points for this interceptor.
Example code:
<action name="someAction" class="com.examples.SomeAction">
<interceptor-ref name="tokenSession/>
<interceptor-ref name="basicStack"/>
<result name="success">good_result.ftl</result>
</action>
<-- In this case, myMethod of the action class will not
get checked for invalidity of token -->
<action name="someAction" class="com.examples.SomeAction">
<interceptor-ref name="tokenSession>
<param name="excludeMethods">myMethod</param>
</interceptor-ref name="tokenSession>
<interceptor-ref name="basicStack"/>
<result name="success">good_result.ftl</result>
</action>
ConditionalInterceptor.LegacyAdapterINVALID_TOKEN_CODEexcludeMethods, includeMethods| Constructor and Description |
|---|
TokenSessionStoreInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
handleInvalidToken(ActionInvocation invocation)
Handles processing of invalid tokens.
|
protected String |
handleToken(ActionInvocation invocation) |
protected String |
handleValidToken(ActionInvocation invocation)
Handles processing of valid tokens.
|
doIntercept, getErrorMessage, setTextProviderFactoryapplyInterceptor, getExcludeMethodsSet, getIncludeMethodsSet, intercept, setExcludeMethods, setIncludeMethodsintercept, shouldIntercept, shouldInterceptdestroy, init, setDisabledclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadaptadaptdestroy, initprotected String handleToken(ActionInvocation invocation) throws Exception
handleToken in class TokenInterceptorExceptionprotected String handleInvalidToken(ActionInvocation invocation) throws Exception
InvocationSessionStore.loadInvocation(String key, String token) for details.handleInvalidToken in class TokenInterceptorinvocation - Exceptionprotected String handleValidToken(ActionInvocation invocation) throws Exception
handleValidToken(ActionInvocation).
See InvocationSessionStore.storeInvocation(String key, String token, ActionInvocation invocation) for details.handleValidToken in class TokenInterceptorinvocation - ExceptionCopyright © 2000–2024 Apache Software Foundation. All rights reserved.