Web Project 轉 Dynamic Web Project

來源:互聯網
上載者:User

從MyEclipse轉到Eclipse Java EE IDE,儘可能延續svn項目。

1,從svn檢出Web Project,將被識別為Java Project而不能發布到Server。

2,建立同名Dynamic Web Project, 配置Build Path –> Source –> Default output folder為WebRoot\WEB-INF\classes,Content Directory為WebRoot。

3,將.project、.classpath和.settings檔案夾複製到檢出的項目,這時已經可以識別為Dynamic Web Project項目了。

4,右鍵項目開啟屬性對話方塊,重新設定Build Path,在Deployment Assembly添加Java Build Path Entries將所有的依賴jar都加上,在Web Project Setting配置上下文路徑Context root。

(以上2、3、4比較山寨哈,其實可以調出項目的屬性,選擇Project Facets,添加Dynamic Web Module和JavaScript特性,在右側選擇Runtimes配置好的tomcat;如果項目的發布目錄為WebContent而不是原來的WebRoot,則修改.settings/org.eclipse.wst.common.component裡的根目錄對應的web-resource的source-path即可;如果項目的依賴jar包不再WEB-INF/lib下,則在項目屬性Deployment
Assembly添加Java Build Path Entries;如果資料庫沒有表結構,則可以讓hibernate自動產生,在db.cfg.xml裡添加<property name="hibernate.hbm2ddl.auto">update</property>)

5,右鍵Run As –> Run on server,項目發布在.metadata\.plugins\org.eclipse.wst.server.core下的臨時目錄裡,遇到逾時問題時修改servers.xml的start-timeout即可(也許不管用)。查看Servers試圖,右鍵server –> Properties,左邊General頁面點擊Switch Location就可以在Servers目錄下看到server設定檔,雙擊開啟編輯Timeouts即可。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.