Java 在Spring中与PathVariable一起使用时未加载CSS
当与Spring一起使用时,我面临CSS加载问题。请查找下面的代码Java 在Spring中与PathVariable一起使用时未加载CSS,java,html,css,spring,Java,Html,Css,Spring,当与Spring一起使用时,我面临CSS加载问题。请查找下面的代码 @RequestMapping(value = "/view/{id}" , method = RequestMethod.GET) public ModelAndView viewStudentById(@PathVariable("id") int id) { ModelAndView model = new ModelAndView("viewStudent"); model.add
@RequestMapping(value = "/view/{id}" , method = RequestMethod.GET)
public ModelAndView viewStudentById(@PathVariable("id") int id) {
ModelAndView model = new ModelAndView("viewStudent");
model.addObject("studentdata",this.studentService.findStudentById(id));
return model;
}
但是加载了“viewStudent”jsp页面的value=“/view”CSS。有人能帮我解决这个问题吗?为什么我不能用(value=“/view/{id}”)加载CSS?我通过下面的代码修复了这个问题
@RequestMapping(value = "/view/{id}" , method = RequestMethod.GET)
public ModelAndView viewStudentById(@PathVariable("id") int id) {
ModelAndView model = new ModelAndView("viewStudent");
model.addObject("studentdata",this.studentService.findStudentById(id));
return model;
}
我失踪了