You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2014/04/22 08:47:54 UTC

[06/11] git commit: Adds JavaDoc

Adds JavaDoc


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/5664284a
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/5664284a
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/5664284a

Branch: refs/heads/feature/http-interceptor
Commit: 5664284a685bf6dd510ee94711dd6d9139c93a13
Parents: 9930ceb
Author: Lukasz Lenart <lu...@apache.org>
Authored: Sat Apr 19 21:12:49 2014 +0200
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Sat Apr 19 21:12:49 2014 +0200

----------------------------------------------------------------------
 .../httpmethod/HttpMethodInterceptor.java       | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/5664284a/core/src/main/java/org/apache/struts2/interceptor/httpmethod/HttpMethodInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/interceptor/httpmethod/HttpMethodInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/httpmethod/HttpMethodInterceptor.java
index 36efb52..e22e6a7 100644
--- a/core/src/main/java/org/apache/struts2/interceptor/httpmethod/HttpMethodInterceptor.java
+++ b/core/src/main/java/org/apache/struts2/interceptor/httpmethod/HttpMethodInterceptor.java
@@ -12,6 +12,26 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
+/**
+ * Interceptor is used to control with what http methods action can be called,
+ * if request with not allowed method was performed, {@link #badRequestResultName}
+ * will be returned or if action implements {@link HttpMethodAware}
+ * and {@link HttpMethodAware#getBadRequestResultName()} returns non-null result name,
+ * thus value will be used instead.
+ *
+ * To limit allowed http methods, annotate action class with {@link AllowedMethod} and specify
+ * which methods are allowed. You can also use shorter versions {@link GetOnly}, {@link PostOnly}
+ * and {@link GetPostOnly}
+ *
+ * @see HttpMethodAware
+ * @see HttpMethod
+ * @see AllowedMethod
+ * @see GetOnly
+ * @see PostOnly
+ * @see GetPostOnly
+ *
+ * @since 2.3.18
+ */
 public class HttpMethodInterceptor extends AbstractInterceptor {
 
     public static final Class[] HTTP_METHOD_ANNOTATIONS = { AllowedMethod.class, PostOnly.class, GetOnly.class, GetPostOnly.class };