
Figure 12.3: Creating products in the database
The Middle Tier
As explained in Chapter 11, “N-Tiered Architecture and XML,” the middle
tier server is a servlet that manages various XML documents. There is a
document for the list of merchants or another for the list of products, and
more. The servlet applies style sheets to them.
The middle tier server is made of the
Shop class, shown in Listing 12.5.
Shop decodes the URL and routes the requests to the appropriate object.
Listing 12.5: Shop.java
package com.psol.xcommerce;
import java.io.*;
import java.util.*;
import org.w3c.dom.*;
import javax.servlet.*;
import javax.servlet.http.*;
/**
* Shop manages the shop, ...