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.
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.
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.
You need Servlet-api. jar to compile servlets in eclipse but while deploying servlet container ( like tomcat ) will have it built in.
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.
You can get apache source code from the apache tomcat website: http://tomcat.apache.org/index.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With