新建项目或导入项目eclipse出现找不到常见包的问题 "javax.servlet.http.HttpServlet"等

版权声明:任何形式的转载请注明出处 https://blog.csdn.net/weixin_42259823/article/details/85944590

当一些常用的包出现找不到的问题import异常,比如:

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

特别是当项目进行迁移(import的项目等)时,可以考虑使用该方法:Web项目右键--->Build Path--->Configure Build Path

点击Add Library,选择Server Runtime,选择配置的tomcat服务器,Finish后不要忘了点击Apply。

配置完成之后,重新Build一下项目。

http://chencheng.vip/csdn/

猜你喜欢

转载自blog.csdn.net/weixin_42259823/article/details/85944590