Eclipse+Tomcat配置中遇到的錯誤

來源:互聯網
上載者:User

標籤:

1  

eclipse發布項目報錯:Multiple Contexts hava a path of “/xxx“


1.1在Eclipse的Servers中單擊“server.xml”檔案並開啟

650) this.width=650;" src="http://www.codingwhy.com/data/upload/image/20150126/1422272090102197.jpg" alt="在Eclipse的Servers中開啟“server.xml”" style="margin:0px;padding:0px;" />

1.2在"server.xml"檔案中,可以看到重複定義的context,刪掉1個即可

650) this.width=650;" src="http://www.codingwhy.com/data/upload/image/20150126/1422272220913911.jpg" alt="刪除“server.xml”中重複定義的檔案中,可以看到重複定義的context" style="margin:0px;padding:0px;" />


2   問什麼我啟動服務以後用瀏覽器訪問Tomcat會報404?


點開你的servers標籤,雙擊你的Tomcat

看到你的Tomcat的Server Locations選中的是第一個,就是說,web運行時eclipse把你的工程放到那個預設的檔案夾下去了,而那個檔案夾沒有Tomcat首頁的Root檔案


參考連結:

http://blog.csdn.net/lanzhizhuxia/article/details/8087709

http://showlike.iteye.com/blog/1549663

http://www.codingwhy.com/686.html




Servlet遇到問題:

   404問題:



  405問題:           

1,繼承自HttpServlet的Servlet沒有重寫對於請求和響應的處理方法:doGet或doPost等方法;預設調

用父類的doGet或doPost等方法;

2,父類HttpServlet的doGet或doPost等方法覆蓋了你重寫的doGet或doPost等方法;

不管是1或2,父類HttpServlet的doGet或doPost等方法的預設實現是返回狀態碼為405的HTTP錯誤表示

對於指定資源的要求方法不被允許。

解決方案:重寫doGet,doPost並且不要重寫super.doGet和doPost方法



本文出自 “心向菩提” 部落格,請務必保留此出處http://zhongkun.blog.51cto.com/1057583/1619147

Eclipse+Tomcat配置中遇到的錯誤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.