Java Reference
In-Depth Information
if ( pool != null ) {
// empty the pool
// Remove the Attribute from the ServletContext
else {
System.err.println(“Could not get a reference to Pool!”);
The only change from the ConnectionPoolServlet found in Chapter 7 is the name of the
servlet. The URL has been changed to point to the trader data source, and the number of con-
nections has been set to two. Make sure you also add the following code snippet to the trader's
web.xml file:
This snippet preloads the TraderConnectionPool when the Tomcat engine starts up.
Now you need to define the interface with which your users will interact. From the require-
ments defined in the first section of this chapter, you will need to create four views and an
error page.
Trader Layout
Each of these pages, excluding the error page, will have the basic layout shown in Figure 22.1.
As you can see, the trader layout has three basic parts. Starting from the top is the Title Bar,
where you see a simple graphic of the Sams logo plus an HTML stock quote form, which will
display the latest pricing for an entered stock symbol. This Title Bar will be at the top of all of
your Views and will be represented by the titlebar.jsp page. Figure 22.2 shows an image of
the real contents of the Title Bar.
Search WWH ::

Custom Search