public class HttpMethodInterceptor extends AbstractInterceptor
badRequestResultName
will be returned or if action implements HttpMethodAware
and HttpMethodAware.getBadRequestResultName() returns non-null result name,
thus value will be used instead.
To limit allowed http methods, annotate action class with AllowedHttpMethod and specify,
which methods are allowed. You can also use shorter versions HttpGet, HttpPost,
HttpPut, HttpDelete and HttpGetOrPost
You can combine any of these annotations to achieve required allowed methods' filtering.
HttpMethodAware,
HttpMethod,
AllowedHttpMethod,
HttpGet,
HttpPost,
HttpPut,
HttpDelete,
HttpGetOrPost,
Serialized FormConditionalInterceptor.LegacyAdapter| Constructor and Description |
|---|
HttpMethodInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
doIntercept(ActionInvocation invocation,
AnnotatedElement element) |
protected String |
getBadRequestResultName(ActionInvocation invocation) |
String |
intercept(ActionInvocation invocation)
Override to handle interception
|
protected List<HttpMethod> |
readAllowedMethods(AnnotatedElement element) |
void |
setBadRequestResultName(String badRequestResultName) |
intercept, shouldIntercept, shouldInterceptdestroy, init, setDisabledclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadaptadaptdestroy, initpublic String intercept(ActionInvocation invocation) throws Exception
AbstractInterceptorintercept in class AbstractInterceptorExceptionprotected String doIntercept(ActionInvocation invocation, AnnotatedElement element) throws Exception
Exceptionprotected List<HttpMethod> readAllowedMethods(AnnotatedElement element)
protected String getBadRequestResultName(ActionInvocation invocation)
public void setBadRequestResultName(String badRequestResultName)
Copyright © 2000–2025 Apache Software Foundation. All rights reserved.