[转]The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
完整错误信息:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOTLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESSFOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THECOPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICTLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING INANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF SUCH DAMAGE.
Description Resource Path Location Type
The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path add.jsp /dwz-Java/WebContent/WEB-INF/jsp/management/news line 1 JSP Problem
简而言之:没有配置Web服务器。
在出现此错误的项目上单击鼠标右键-->Build Path-->Configure Build Path
到了添加Server Library步骤时,里面是空选项,没有Tomcat 7.0选择,怎么办?
1、选择 eclipse 的WIndows菜单》Preferences 预设
2、在左侧列表中找到 Server 项,展开,选中:Runtime Environments,右侧点击添加按钮
3、这里要根据你使用的 Tomcat 版本来选择,不一定是 Tomcat 7.0;
我这里是演示添加 Tomcat,当然也可以选择添加 IBM 的 Liberty ,或者 JBoss 之类的 Web 服务器(Java EE容器)
如果你还没有安装 Tomcat,那可以去官网下载一个压缩包解压到一个目录就可以了。
4、点击 Browse 按钮选择 Tomcat 所在的位置
选择 JRE (Java Runtime Environment),当然你可以使用 Eclipse 自带的,
但如果你想使用自己安装的版本就需要添加一下;初学使用自带的就可以了;
5、上面一切就绪点击 Finish 按钮就可以了。
参考文档:
http://blog.csdn.net/testcs_dn/article/details/36455669
http://blog.csdn.net/testcs_dn/article/details/70336604