在進行servelet跳轉時可能會出現:SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:aa' did not find a matching property的問題。
這是什麼問題呢?
這是由於在eclipse下,在WEB工程中部署tomcat時,所生成的serves文件夾下,會自動生成該web工程的一個server.xml的配置文件.如下圖:
server.xml中存在一個context的元素,默認情況下不支持名稱爲source的屬性,如下圖:需要對其默認方式進行修改
如何解決這個問題呢?
停止tomcat運行,雙擊eclipse中的tomcat服務器,會出現一個在出來的Tomcat server at localhost窗口中找到server options選項,選中其中的選項”Publish modual contexts to separat XML files“,保存(ctr+s),再重新啓動tomcat。