This question already has answers here: Why do I get the error “File cannot be resolved to a type”? (4个答案) 6个月前关闭。 我试图在我的其余终结点类(春季启动项目)中添加ResponseEntity ,在该地方不允许添加,并且由于“ ResponseEntity无法解析为类型”而出现编译错误。请让我知道为什么我无法将它们添加到我的项目中。我也想知道响应时处理HTTP状态代码的方法吗?提前致谢! (adsbygoogle = window.adsbygoogle || []).push({}); 最佳答案 您如何初始化ResponseEntity?您可以执行以下操作:ResponseEntity<String> responseEntity = new ResponseEntity<>(HttpStatus.OK); (adsbygoogle = window.adsbygoogle || []).push({});
10-07 13:26
查看更多