If you want to achieve the same thing on a method annotated with @InitBinder, the same does not apply. However, you can simply do this:
@InitBinder
public void initBinder(HttpServletRequest request) {
if ("POST".equals(request.getMethod()){
//Do something
}
}
Why would you want to know the type of request in an @InitBinder method? Stay tuned to find out one pretty cool application.
0 comments:
Post a Comment