We are migrating our project from the Sun App server to Glassfish. For compilation we need the classpath to be set to the servlet-api.jar which is found in the servlet container. Where in the Glassfish installation can I find these jars?
Thanks.
It contains, among others, the files /usr/share/java/servlet-api-2.5. jar and /usr/share/java/jsp-api-2.1. jar , which are the servlet and JSP libraries you need.
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.
GlassFish Server supports the Java Servlet Specification version 3.0. Note - Servlet API version 3.0 is fully backward compatible with versions 2.3, 2.4, and 2.5, so all existing servlets should work without modification or recompilation.
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.
I guess you want to use Glassfish 3 or higher.
You can find the servlet-api in
$GLASSFISH_HOME\glassfish\modules\javax.servlet-api.jar
in Glassfish 3 and 4.
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