Search code examples
poststruts2getrequestaction

How to know if HTTP request is GET or POST in Struts 2 action?


Is there a way to know in Struts2 action's method if this is GET or POST request?


Solution

  • You can use HTTPServletRequest.getMethod() to find out that and handle accordingly in action.