當一些常用的包出現找不到的問題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://comonly.cn/i/