Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/90.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在Spring中与PathVariable一起使用时未加载CSS_Java_Html_Css_Spring - Fatal编程技术网

Java 在Spring中与PathVariable一起使用时未加载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

当与Spring一起使用时,我面临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;
    }

但是加载了“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;
    }

我失踪了