Testing Tomcat
To test the server—assuming you’re running Tomcat on the same machine as the browser and that you’re using the default port for Tomcat (8080)—open a browser and enter the following URL in the Location/Address field:
| http://localhost:8080/ |
The Tomcat main page is shown in the browser (see Figure 4.2), and you can now run all servlet and JSP examples bundled with Tomcat to make sure everything works.

Figure 4-2. The Tomcat main page
When you’re done testing Tomcat, stop the server like this:
C:\Jakarta\jakarta-tomcat\bin>shutdownYou should always stop the server this way, as opposed to killing the Command Prompt window the server is running in. Otherwise, the applications don’t get a chance to close down gracefully, and when you start to connect external resources, like a database, various problems may occur.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access