Second, set development, operating environment

zhaozj2021-02-16  139

2.1 Installing Servlet and JSP Development Tools To learn Servlet and JSP development, first you must prepare a development environment that meets Java Servlet 2.1 / 2.2 and JavaServer Pages1.0 / 1.1 specification. Sun offers free JavaServer Web Development Kit (JSWDK), you can download from http://java.sun.com/products/servlet/. After installing JSWDK, you have to tell Javac, where to find the Servlet and JSP classes when compiling files. The JSWDK Installation Guide has a detailed description of this, but mainly to join servlet.jar and jsp.jar to ClassPath. ClassPath is an environment variable indicating how Java is looking for class files. If you do not set ClassPath, Java is looking for classes in the current directory and standard system library; if you settle ClassPath, don't forget to include the current directory (ie, in classpath ". "). In addition, in order to avoid name conflicts to install and other developers to servlets on the same web server, it is best to put their own servlet into the package. At this point, there is a lot of convenience to ClassPath in the top-level directory in the package hierarchy. Please refer to the details below. 2.2 Installation Support Servlet Web Server In addition to development tools, you have to install a web server that supports Java Servlet, or installs 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 necessary software. Check the web server document, or visit http://java.sun.com/products/servlet/industry.html View the list of server software that supports servlet. Although the final run Servlet is often a business-grade server, it is enough to develop and test with a free system that can run on the desktop. Below is a few of the current most popular products. Apache Tomcat. Tomcat is an official reference implementation of Servlet 2.2 and JSP 1.1 specification. Tomcat can be used separately as a small servlet, a JSP test server, or can also be integrated into the Apache Web server. Until 2000, Tomcat is only the only server that supports Servlet 2.2 and JSP 1.1 specification, but many other servers have announced their support. Tomcat and Apache are free. However, fast, stable Apache servers have a bit troublesome, Tomcat has the same shortcomings. Compared with other business-grade Servlet Engines, the workload of Tomcat is obviously more than one. For details, see http://jakarta.apache.org/. JavaServer Web Development Kit (JSWDK). JSWDK is an official reference implementation of Servlet 2.1 and JSP 1.0. The JSWDK can be separate as a small servlet, a JSP test server before deploying Servlet and JSP applications to officially running their servers. JSWDK is also free and has good stability, but its installation and configuration is also more complicated. For details, see http://java.sun.com/products/servlet/download.html. Allaire Jrun. JRun is a servlet and JSP engine that can be integrated into Netscape Enterprise or FastTrack Server, IIS, Microsoft Personal Web Server, low version of Apache, O'Eilly's WebSite or Starnine Web Star.

转载请注明原文地址:https://www.9cbs.com/read-9017.html

New Post(0)