1、部署tomcat
在下載完tomcat壓縮包後直接解壓到無中文路徑下即可,7以上版本不需要配置環境
2、在eclipse內構建server
點擊windows-preference-server-runtime_Environment ->add ->Apache.tomcat8.0(根據你安裝的版本)勾選Create a new local server -->next --- name(隨意) installation directory(本地tomcat安裝路徑)->finish
->去工作臺servers窗口->雙擊新創建的server,server Locations 選擇第一個Use workspace metadata(does not modify tomcat installation)
3、新建web項目
右鍵new->web->Dynamic Web Project -next->name(隨意) -next->(坑)Default output folder 用這個 WebContent\WEB-INF\class(這個是web項目編譯完成後默認目錄,如果剛開始沒選這個 ,當你運行時會報錯(notfound servlet),也可以通過project->clean ->你這個web項目,然後右鍵項目->build path ->configure build path ->java build path ->source重新改下地址)