In ASP, there\'s request.form
and request.queryString
attributes, but in Java. It seems like we have only one collection, which can be accessed via
You can use request.getMethod() to get any Method. I am using HandlerInterceptor for this.
check this code:
public class LoggingMethodInterceptor implements HandlerInterceptor {
Logger log = LoggerFactory.getLogger(LoggingMethodInterceptor.class);
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws Exception {
log.info("[START] [" + request.getMethod() + "] [" + request.getRequestURL() + "] StartTime: {} milliseconds",
System.currentTimeMillis());
return true;
}