background image

Configuring the Example

<< The Flow of a Request | Types of Tags >>
<< The Flow of a Request | Types of Tags >>

Configuring the Example

6. Click Open Project Folder.
7. In the Projects tab, right-click the bookstore3 project, and select Deploy Project.
8. To run the application, open the bookstore URL
http://localhost:8080/bookstore3/bookstore
.
To deploy and run the application using Ant, follow these steps:
1. In a terminal window, go to tut-install/javaeetutorial5/examples/web/bookstore3/.
2. Type ant. This command will spawn any necessary compilations, copy files to the
tut-install/javaeetutorial5/examples/web/bookstore3/build/ directory, and create a
WAR file and copy it to the
tut-install/javaeetutorial5/examples/web/bookstore3/dist/ directory.
3. Start the Application Server.
4. Perform all the operations described in
"Creating a Data Source in the Application Server"
on page 98
.
5. To deploy the example, type ant deploy. The deploy target outputs a URL for running the
application. Ignore this URL, and instead use the one shown in the next step.
6. To run the application, open the bookstore URL
http://localhost:8080/bookstore3/bookstore
.
To learn how to configure the example, refer to the web.xml file, which includes the following
configurations:
A display-name element that specifies the name that tools use to identify the application.
A context-param element that specifies the JSTL resource bundle base name.
A listener element that identifies the ContextListener class used to create and remove
the database access.
A servlet element that identifies the Dispatcher instance.
A set of servlet-mapping elements that map Dispatcher to URL patterns for each of the
JSP pages in the application.
Nested inside a jsp-config element is a jsp-property-group element, which sets the
properties for the group of pages included in this version of Duke's Bookstore. See
"Setting
Properties for Groups of JSP Pages" on page 179
for more information.
To run the example, open the bookstore URL
http://localhost:8080/bookstore3/bookstore
.
See
"Troubleshooting Duke's Bookstore Database Problems" on page 102
for help with
diagnosing common problems.
The Example JSP Pages
The Java EE 5 Tutorial · September 2007
228