在配置DispatcherServlet的时候将url-pattern设置为/api/*
启动服务后
@RestController
@RequestMapping(value = "/api", produces = MediaType.APPLICATION_JSON_VALUE + ";charset=UTF-8")
public class RestfulController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@RequestMapping(value = "/test" , method=RequestMethod.GET)
public void test(){
logger.info("restful test");
}
}
调用接口报404,http://localhost:8088/admin/api/test