Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
2.1 Installing the servlet and JSP development tools
To learn about servlet and JSP development, you must first prepare a development environment that conforms to the Java Servlet 2.1/2.2 and JavaServer pages1.0/1.1 specifications. Sun offers free JavaServer Web Development Kit (JSWDK), which can be downloaded from http://java.sun.com/products/servlet/.
After installing the JSWDK, you will also tell Javac where to find the servlet and JSP classes when compiling the files. The JSWDK Installation Guide describes this in detail, but the main thing is to add Servlet.jar and Jsp.jar to Classpath. Classpath is an environment variable that instructs Java how to look for class files, if you do not set Classpath,java to look for classes in the current directory and standard system libraries, and if you set the classpath yourself, don't forget to include the current directory (that is, include in the Classpath " .” ）。
In addition, to avoid naming conflicts with other developers installing to the servlet on the same Web server, it is best to put your servlet in the package. At this point, adding classpath to the top-level directory in the package hierarchy can be quite handy. Please refer to the details below.
2.2 Installing a Web server that supports servlet
In addition to the development tools, you will install a Web server that supports the Java servlet, or install a servlet package on an existing Web server. If you are using the latest Web server or application server, it is likely that it already has all the necessary software. Check your Web server's documentation or visit http://java.sun.com/products/servlet/industry.html to view a list of server software that supports the servlet.
While it is often the business-Class server that ultimately runs the servlet, it's enough to start learning with a free system that can run on a desktop. Here are some of the most popular products today.
Tomcat is an official reference implementation of the servlet 2.2 and JSP 1.1 specifications. Tomcat can be used as either a small servlet, a JSP test server, or an Apache Web server. Until the early 2000, Tomcat was the only server that supported the servlet 2.2 and JSP 1.1 specifications, but many other servers have announced support for this.
Tomcat is free as well as Apache. However, fast, stable Apache server installation and configuration is a bit cumbersome, Tomcat has the same disadvantage. Compared to other business-level servlet engines, it is obvious that the workload of configuring Tomcat is a little more. Please see http://jakarta.apache.org/for details.
JavaServer Web Development Kit (JSWDK).
JSWDK is an official reference implementation of Servlet 2.1 and JSP 1.0. Before you deploy servlet and JSP applications to the server where they are officially running, JSWDK can be used as a small servlet, JSP test server alone. JSWDK is also free, and has a good stability, but its installation and configuration is also more complex. Please see http://java.sun.com/products/servlet/download.html for details.
JRun is a servlet and JSP engine that can be integrated into Netscape Enterprise or FastTrack Server, IIS, Microsoft Personal Web Server, lower-version Apache, O ' eilly website or starnine Web STAR. A limited version of up to 5 concurrent connections is free, this restriction is not present in the commercial version, and features such as remote management consoles are added. Please see http://www.allaire.com/products/jrun/for details.
the servletexec of New Atlanta
Servletexec is a fast servlet and JSP engine that can be integrated into most popular web servers, including Solaris, Windows, MacOS, HP-UX, and Linux. Servletexec can be downloaded and used for free, but many advanced features and management tools are available only after you have purchased a license. The New Atlanta also provides a free servlet debugger that works under many popular Java Ides. Please see http://newatlanta.com/for details.
Gefion's Litewebserver (LWS)
LWS is a free small Web server that supports Servlet 2.2 and JSP 1.1. Gefion also has a free Waicoolrunner plugin that can be used to add servlet 2.2 and JSP 1.1 support for Netscape FastTrack and Enterprise Server. Please see http://www.gefionsoftware.com/for details.
Sun's Java Web Server.
This server is all written in Java and is one of the first Web servers to provide full support for the servlet 2.1 and JSP 1.0 specifications. Although Sun has now turned to Netscape/i-planet server and is no longer developing Java Web Server, it is still a popular servlet, JSP learning platform. To get a free trial version, visit http://www.sun.com/software/jwebserver/try/.
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
and provide relevant evidence. A staff member will contact you within 5 working days.