Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add Javadoc for Servlet API in Eclipse

I've a dynamic web app in Eclipse that is using Tomcat as runtime environment.

I cannot add Javadoc path Tomcat Servlet API: as appears, the edit button is always disabled!

alt text http://filaty.com/i/1005/80306/tom.JPG

like image 754
Muhammad Hewedy Avatar asked May 19 '10 21:05

Muhammad Hewedy


People also ask

How to install servlet-api in Eclipse?

For adding a jar file, right click on your project -> Build Path -> Configure Build Path -> click on Libraries tab in Java Build Path -> click on Add External JARs button -> select the servlet-api. jar file under tomcat/lib -> ok. Now servlet has been created, Let's write the first servlet code.


1 Answers

In Package Explorer of your project go to Java Resources > Libraries. Rightclick servlet-api.jar, choose Properties and specify the source location there (the apache-tomcat-x.x.x-src.zip file).

Another way is to just open any Servlet API class using Ctrl+Shift+T or by Ctrl+Click on any import/declaration in existing code and then click the Attach Source... button and specify it there.

like image 86
BalusC Avatar answered Sep 30 '22 19:09

BalusC