Java Reference
In-Depth Information
1 5 . To stop Tomcat, enter the following command into the (fi rst) command window:
shutdown
(This assumes, of course, that your PAT H variable has been modifi ed as
described four steps earlier.)
For Windows 7 users, the PAT H or CLASSPATH environment variable may be
modifi ed or a new environment variable created by following the steps given below.
(The CLASSPATH environment variable may itself not exist before this, in which
case it should be treated as a new environment.)
1. Select Start -> Control Panel from the bottom left corner of the desktop.
2. Click on the System and Security sub-heading.
3. Click on the System sub-heading.
4. Click on the Advanced system settings link in the left-hand pane.
5. Click on the Environment Variables… button in the bottom right corner.
6 . Either select Path or CLASSPATH from System Variables and then click on Edit
or click on New to create a new environment variable.
7. If adding a new path to Path or CLASSPATH , then either prepend the new path
and a trailing semi-colon (<newPath>;<existingPath>) or append it with a leading
semi-colon (<existingPath>;<newPath>). If creating a new environment variable,
simply enter the name of the new variable and its associated path.
8. Click on OK and then again on OK .
For users of earlier versions of the Windows operating system, the steps will be
somewhat similar to those given above, the only differences likely to be a reference
to Start -> Settings -> Control Panel in the fi rst step and double- clicking on a System
icon in step 2.
For the remainder of this chapter, it is Tomcat that will be used for the execution
of servlets.
8.3
Creating a Web Application
To set up your own servlets (and/or JSPs, as explained in the next chapter), you need
to create a Web application under Tomcat (or make use of an existing one). To create
a new Web application, you need to create the required folder structure immediately
below the existing standard folder webapps in the Tomcat folder structure. The main
part of the folder structure for a Web application called MyWebApp is:
MyWebApp->WEB-INF->classes
[N.B. Upper-case for ' WEB-INF' and lower-case for 'classes' are mandatory .]
The rules governing what makes up a Web application and what goes where in
such an application are listed below. For convenience, the name of the Web
Search WWH ::




Custom Search