Java Reference
In-Depth Information
Download the latest production-quality Tomcat binary release from the Jakarta
web site, located at http://jakarta.apache.org/tomcat. The binary versions of Tom-
cat are distributed as an archive file, so installing it is usually as simple as extract-
ing the archive file to a unique directory on your local file system.
Once Tomcat has been successfully extracted, you need to inform IDEA of its
location. Within IDEA , open the Settings window ( Ctrl+Alt+S ) and choose the
Application Servers configuration item. Click Add to add a new application
server definition, and choose To m c a t S e r v e r from the drop-down. In the To m c a t
Server window that appears, either type in the full path of the directory where
Tomcat is installed or navigate to it using the ellipsis ( ) button. Both paths are
identical for a typical Tomcat installation, and clicking OK finds and registers all
of Tomcat's JAR s with that application server instance. The default name of this
application server entry is Tomcat; you can change it if you'd like.
Finally, you have to associate your web module with that application server.
Return to the Settings window ( Ctrl+Alt+S ) and choose the Paths configuration
item. Select your web module from the list, and then select the Web Module Set-
tings tab. The first option on this tab is Application Server, which you left blank
earlier because no application servers were defined at that time. Now, you can
click the drop-down and choose To m c a t . Persist your changes by clicking OK , and
the association is complete.
11.4 Running and debugging web applications
Once you've completed your web application, you're going to want to run it, and
IDEA gives you several different options depending on the type of application
server you're running and how you prefer to work. You can either let IDEA deploy
and run your web application, as you would run a standalone Java application, or
you can handle deployment and management of the application server yourself,
integrating with IDEA only for its debugging capabilities.
Running a web application is more involved than running a plain Java appli-
cation. In order to run and test a web application, you need to start the web appli-
cation server, deploy the web application on the server, and view the web application
using a web browser. All these steps can be automated, given the right configura-
tion. The Run/Debug configuration profiles that you used to run and debug stan-
dard Java applications earlier in the topic also support running and debugging
web applications, and they effectively group and simplify all these steps in a single,
easily configurable location.
 
 
 
Search WWH ::




Custom Search