Unresolved compilation problem: The method preHandle(HttpServletRequest, HttpServletResponse

java.lang.Error: Unresolved compilation problems: The type javax.servlet.http.HttpServletResponse cannot be resolved. It is indirectly ref erenced from required .class files The type javax.servlet.ServletResponse cannot be resolved. It is indirectly referenced from required .class files The type javax.servlet.ServletRequest cannot be resolved. It is indirectly referenced fr om required .class files The import javax.servlet.http.Cookie cannot be resolved The import javax.servlet.http.HttpServletRequest cannot be resolved The import javax.servlet.http.HttpServletResponse cannot be resolved HttpServletRequest cannot be resolved to a type HttpServletResponse cannot be resolved to a type The type javax.servlet.ServletException cannot be resolved. It is indirectly referenced from required .class files The method buildWrapper() from the type ParameterWrapper refers to the missing t ype ServletException Cookie cannot be resolved to a type Cookie cannot be resolved to a type HttpServletRequest cannot be resolved to a type HttpServletRequest cannot be resolved to a type HttpServletResponse cannot be resolved to a type

 

问题:项目启动时很多报错(其实不用启动,随便点开一个也能发现,@Override的都在报错)!MyEclipse 报错问题。

原因:MyEclipse IDE 使用默认版本,使得 IDE 的Comp iler Compliance level 与 Installed JREs 版本不对应而导致错误。 解决方案:将 IDE 的Compiler Compliance level 与自己安装的java 版本修改为一致。(例 如:Compiler Compliance level 使用1.8时,Installed JREs版本则使用jdk1.8.0 )

路径:window-->preference-->java-->compiler

Unresolved compilation problem: The method preHandle(HttpServletRequest, HttpServletResponse_第1张图片

路径:具体的项目,右键-->properties-->java compiler

Unresolved compilation problem: The method preHandle(HttpServletRequest, HttpServletResponse_第2张图片

你可能感兴趣的:(常见报错,随手记)