0

Whenever i am intercepting request in struts2 interceptor getting httpmethod as GET. My requirement is to disable submission with GET httpmethod. please suggest.

  • Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. – Roman C Apr 18 '16 at 07:15

1 Answers1

1

try somthing like :

  public String intercept(ActionInvocation actionInvocation) throws Exception {
    HttpServletRequest request = ServletActionContext.getRequest();
    if (!request.getMethod().equals("POST")){
        return Action.ERROR;
    }
    return actionInvocation.invoke();
}
tcharaf
  • 630
  • 1
  • 5
  • 11