在java中spring boot 框架加了一个Pathget-daily-send-medicine GET前端访问后端的接口报StandardWrapperThrowablejavalangIllegalStateException The resource configuration is not modifiable in this context怎么解决
这个问题可能是由于在Spring Boot中使用了错误的注解导致的。在Spring Boot中,应该使用@RequestMapping注解来定义接口路径,而不是使用@Path注解。因此,您应该将@Path("get-daily-send-medicine")替换为@RequestMapping("get-daily-send-medicine")。
修改后的代码如下所示:
@RestController
public class MyController {
@RequestMapping("get-daily-send-medicine")
@GetMapping
public String getDailySendMedicine() {
// 处理逻辑
return "success";
}
}
然后,您可以使用http://localhost:8080/get-daily-send-medicine来访问此接口。
如果您仍然遇到问题,请提供更多的代码和错误信息,以便更好地帮助您解决问题
原文地址: https://www.cveoy.top/t/topic/iNjI 著作权归作者所有。请勿转载和采集!