Whenever i am intercepting request in struts2 interceptor getting httpmethod as GET. My requirement is to disable submission with GET httpmethod. please suggest.
Asked
Active
Viewed 326 times
0
-
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 Answers
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
-
1
-
So change the test of not POST to equal to GET : if (request.getMethod().equals("GET")){ return Action.ERROR; } β tcharaf Apr 18 '16 at 13:21