Before you can write a servlet, you need to install some support software. This includes the Java Servlet Development Kit, which will provide you with the classes your servlet will extend, and the Java Web Server, which you can use to test your servlets. You will also learn about some other avenues that you can follow to add servlet support to your Web site.
After completing this module, you will be able to:
Like Java itself, servlets were designed for portability and are supported on all platforms that support Java. Servlets work with all the major web servers like
- JBoss Enterprise Application Platform
- Apache Tomcat
- Apache TomEE
- Apache Geronimo
- Resin Servlet Container (Open Source)
Java servlets, as defined by the Java Software division of Sun Microsystems (formerly known as JavaSoft), are the first standard extension to Java.
This means that servlets are officially blessed by Oracle and are part of the Java language, but they are not part of the core Java API.
Therefore, although they may work with any Java Virtual Machine (JVM), servlet classes need not be bundled with all JVMs.
To make it easy for you to develop servlets, Oracle has made publicly available a set of classes that provide basic servlet support. The
- javax.servlet and
packages constitute this Servlet API.
Version 2.0 of these classes comes bundled with the Java Servlet Development Kit (JSDK) for use with the Java Development Kit version 1.5 and above.
Many web server vendors have incorporated these classes into their servers to provide servlet support, and several have also provided additional functionality.