import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;

import HTML.*;

/*
    This servlet represents the first step in the order
    process.  It is the equivalent of an index.html page.
*/

public class WelcomeServlet extends CatalogServlet {

  // Method Name: init()
  // Purpose: This is the default init() method.
  public void init(ServletConfig config)
    throws ServletException {

    super.init(config);
  }

  // Method Name: buildClientArea()
  // Purpose: This method implements its parents abstract
  // method.  It represents the client area of the browser
  // window.
  public HTMLTable
    buildClientArea(HttpServletRequest request)
    throws Exception {

    // Create the Table to return as the client area.
    HTMLTable table = new HTMLTable();
    table.setWidthByPixel(530);

    HTMLTableRow row = new HTMLTableRow();
    HTMLTableCell cell =
      new HTMLTableCell(HTMLTableCell.DATA);
    cell.setVerticalAlign(HTMLTableCell.TOP);
    cell.setHorizontalAlign(HTMLObject.LEFT);

    // Add a simple message welcoming customers to the
    // site.
    cell.addObject(
      new HTMLHeading("Welcome to the Sams Online Video Store!",
      HTMLHeading.H3));
    row.addObject(cell);
    table.addObject(row);

    return table;
  }

  //Get Servlet information
  public String getServletInfo() {

    return "HTML.WelcomeServlet Information";
  }
}
