admin管理员组文章数量:1612060
would dispatch back to the current handler URL [/student] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
意思:会再次分派回当前处理程序URL [/student]。检查你的视图解析器设置!(提示:这可能是一个未指定视图的结果,由于默认视图名称的生成。
错误代码:
@Controller
@RequestMapping("/student")
public class StudentController {
@Autowired
private StudentService studentService;
@GetMapping
public List<Student> findAll(){
return studentService.findAll();
}
@DeleteMapping("/{id}")
public boolean del(@PathVariable int id){
boolean flas=true;
if (flas){
System.out.print("删除成功");
}else {
System.out.print("删除失败");
}
return flas;
}
}
解决问题:
@Controller把这个注解改成@RestController
本文标签: handlerurldispatchCurrentViewResolver
版权声明:本文标题:would dispatch back to the current handler URL [student] again. Check your ViewResolver setup 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dongtai/1728627697a1166708.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论