小码问答,有问必答!

打开jsp页面报错:The method getContextPath() from the type HttpServletRequest

Multiple annotations found at this line:

- The method getContextPath() from the type HttpServletRequest refers to the missing 

type String

- No exception of type ServletException can be thrown; an exception type must be a 

subclass of Throwable


JavaEE

收藏

1个回答

我要回答

  • author
    wanmatea 2021-03-16 17:10

    这种错误一般是项目的jre路径有问题,如果是用的Eclipse,可以在项目上右键-Build Path,检查一下jre的路劲是不是有红色×号,如果有,删除重新添加就可以了。