Package org.kohsuke.stapler.verb
Class HttpVerbInterceptor
java.lang.Object
org.kohsuke.stapler.interceptor.Interceptor
org.kohsuke.stapler.verb.HttpVerbInterceptor
Restricts the routing to matching HTTP verbs.
Usage
This package defines a number of HTTP verb (method) annotations that can be used to restrict routing. For example,
@WebMethod(name="") @DELETE public void delete() { // this method will be invoked only when the request is DELETE ... } @WebMethod(name="") @POST public void create(@JsonBody Order order) { // this method will be invoked only when the request is POST ... }
This class is the actual logic that implements this semantics on top of Interceptor
.
-
Field Summary
Fields inherited from class org.kohsuke.stapler.interceptor.Interceptor
target
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioninvoke
(StaplerRequest2 request, StaplerResponse2 response, Object instance, Object[] arguments) Intercepts the call.Methods inherited from class org.kohsuke.stapler.interceptor.Interceptor
invoke, setTarget
-
Constructor Details
-
HttpVerbInterceptor
public HttpVerbInterceptor()
-
-
Method Details
-
invoke
public Object invoke(StaplerRequest2 request, StaplerResponse2 response, Object instance, Object[] arguments) throws IllegalAccessException, InvocationTargetException, jakarta.servlet.ServletException Description copied from class:Interceptor
Intercepts the call.The minimal no-op interceptor would do
target.invoke(request,response,instance,arguments)
, but the implementation is free to do additional pre/post processing.- Overrides:
invoke
in classInterceptor
- Parameters:
request
- The current request we are processing.response
- The current response object.instance
- The domain object instance whose method we are about to invoke.arguments
- Arguments of the method call.- Returns:
- Return value from the method.
- Throws:
InvocationTargetException
- if you want to send e.g. something fromHttpResponses
IllegalAccessException
jakarta.servlet.ServletException
-