eclipse刚安装好,新建工程的时候jsp页面顶端出现错误: The superclass
“javax.servlet.http.HttpServlet” was not found on the Java Build Path”
在网上查了很多方法,就一个行的通。
主要参考:http://stackoverflow.com/questions/22756153/the-superclass-javax-servlet-http-httpservlet-was-not-found-on-the-java-build
报错的原因:虽然已经把tomcat下载解压了,并且能启动工作,但是还没有给eclipse指定服务器路径,换句话说就是还没给eclipse安装服务器。
步骤: 1- If you didn’t install any server you have to do these step:
Window > Preferences > Expend Server > Runtime environment > Add >
choose a name than choose apache server path that you already
installed on your pc. (you can press download and install too ) >
Finish > OK2- Add the tomcat server: Project Properties-> Java Build Path-> Add
Library -> Select “Server Runtime” from the list-> Next->Select
“Apache Tomcat”-> Finish
详细步骤:
第一步:
第二步:
大功告成!