在使用servlet 3.0新特性Comet時,常會出現"The method startAsync() is undefined for the type HttpServletRequest"錯誤顯示,而在項目中已經引入了servlet 3.0 的相關jar,依然報錯,一直沒有在網上找到解決辦法,後來發現是因爲在使用eclipse創建web項目時,它會引入eclipse自帶的servlet包,這樣它就不適用添加到項目lib下得servlet 3.0的jar。在項目包路徑中將從eclipse中引入的包刪除後問題解決:
remove J2EE 1.4 Libraries項問題解決。