"message": "No message available", "path": "/data/test" } 后台程序看接口访问正常,可以正常输出日志,但是到postman工具中就报404错误 最终排查下来是缺少了@ResponseBody 注解。 @ResponseBody 来看看为什么要添加这个注解 The course documentation states that this annotation serves the function to: ensure ...
import java.text.MessageFormat; import java.util.*; @Order(Ordered.HIGHEST_PRECEDENCE)//最高优先级 方便拦截404什么的 public class LoggableDispatcherServlet extends DispatcherServlet { private static final Logger logger = LoggerFactory.getLogger("HttpLogger"); private static final ObjectMapper mapper = ...