一、下載tomcat source code:
下載頁面(以7.0為例):http://tomcat.apache.org/download-70.cgi
下載 Source Code Distributions 的tar.gz或zip檔
二、attach到eclipse:
方法1:Ctrl+Click 點選.java檔中使用Tomcat/Servlet API的程式碼(ex: HttpServlet),然後將剛才下載的source code從external location attach上去
方法2:在Project Explorer中,對自己的Project底下的Java Resources > Libraries > Apache Tomcate v7.0的jar檔按右鍵(ex: servet-api.jar) > Properties,然後在Java Source Attachment的External location將剛才下載的source code attach上去
------
Source:
[1] How can I download Java Servlet documentation and attach with eclipsehttp://stackoverflow.com/questions/5675041/how-can-i-download-java-servlet-documentation-and-attach-with-eclipse
[2] How to add Javadoc for Servlet API in Eclipse
沒有留言:
張貼留言