org.apache.struts2.interceptor.httpmethod

## Interface HttpMethodAware

-     public interface HttpMethodAware

  Action when implements this interface is notified about what method was used to perform request, it works in connection with `HttpMethodInterceptor` Another function of this interface is to return result, which should be returned when action was called with wrong http method
  Since:
    6.2.0
  See Also:
    `HttpMethodInterceptor`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getBadRequestResultName()` Action name to use when action was requested with wrong http method can return null and then default result name will be used instead defined in `HttpMethodInterceptor`
    `void` | `setMethod(HttpMethod httpMethod)` Notifies action about http method used to perform request

- - ### Method Detail

    - #### setMethod

          void setMethod(HttpMethod httpMethod)

      Notifies action about http method used to perform request
      Parameters:
        `httpMethod` - `HttpServletRequest.getMethod()` translated to enum

    - #### getBadRequestResultName

          String getBadRequestResultName()

      Action name to use when action was requested with wrong http method can return null and then default result name will be used instead defined in `HttpMethodInterceptor`
      Returns:
        result name or null

Copyright © 2000–2026 Apache Software Foundation. All rights reserved.