Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I get the source code of the servlet-api.jar?

Tags:

java

servlets

I have a project that uses servlet-api.jar. When debugging, I wanted to step into its classes (such as HttpServlet), but I got "Source not found attach source ".

Is there a way to get the source like all the Java sources? It would be good to have so I would be able to debug it and to step into the code.

like image 854
Elye M. Avatar asked Aug 06 '12 21:08

Elye M.


People also ask

What is the use of servlet API jar?

What is it? The servlet-api jar is a library which contains the interfaces and classes of the Servlet API specification. The servlet-api jar contains only the interface (the API) of the Servlet Specification, so you can use it to develop your web application.

What is servlet code?

A servlet is a Java Programming language class that is used to extend the capabilities of servers that host applications accessed by means of a request-response programming model. Although servlets can respond to any type of request, they are commonly used to extend the applications hosted by web servers.

What JAR files are required for servlets?

You need Servlet-api. jar to compile servlets in eclipse but while deploying servlet container ( like tomcat ) will have it built in.

Where do I put 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

You can get apache source code from the apache tomcat website: http://tomcat.apache.org/index.html

like image 182
Nick Rippe Avatar answered Oct 12 '22 19:10

Nick Rippe