Eclipse 的 Tomcat 環境設定
前提 1: 必須是 Eclipse IDE for Java EE 才有此設定.
前提 2: 到 Apache Tomcat 網址, 若只要供 Eclipse 使用, 則下載 zip 或 tar.gz 這種免安裝檔即可.
1) Menu: Window > Preferences, 移動到 Server > Runtime Environments :

選擇 Apache Tomcat 版本 :

點選 "Browse" 鈕, 選擇 Apache Tomcat 根目錄 :

設定完成 :

2)在 Eclipse 中, 新增一個 "Dynamic Web Project" 專案 :

輸入 Project Name 與運行的 Target runtime :

3)新增一個 JSP File 或 HTML File :

選擇檔案的所在目錄 WebContent 與 檔案名稱 :

4)在專案的地方按右鍵, 選擇 Run As > Run on Server, 進行運行 :

選擇運行的 Target runtime 環境 :

運行結果 :

沒有留言:
張貼留言