项目jsp不能引入Servlet错误

        在项目中会出现一些jsp报错,报错信息是The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path,其原因是没有引入servlet-api.jar错误,因为这个jar包是在tomact服务器lib中,所以我们在引入tomact服务器是会首先加载里面的servlet-api.jar.因此我们不必额外在项目中添加servlet-api.jar到lib中。但是现在无法被引入,首先要查看下项目是否引入了tomact,应该是没有引入。

      方法:右击项目->build path ->configure build path -> libraries->add library(server run time -> apache tomcat),-> order and export(将apache tomcat 放在首位)。

   The superclass "javax.servlet.jsp.tagext.SimpleTagSupport" was not found on the Java Build Path错误也是一样,这个是没有引入jsp-api.jar包,这个包也在tomact中,所以当tomact被引入是错误就会解决。

你可能感兴趣的:(项目jsp不能引入Servlet错误)