Class Name
Description
MultipartRequest
The MultipartRequest class is used to process the application form.
Since the application form contains mixed content (both an input stream
for a file upload, and regular form data), the processing is different from
a standard doGet() servlet method. Please see Section 5.3 for a
detailed discussion of file uploading with servlets.
MyCalendar
The MyCalendar class is the interface between the MySQL date format
and the Java date format of the GregorianCalendar class. Conversion
methods are provided in this class.
Street
Supplementary classes to access the corresponding database tables.
WorkType
StreetWorkType
Table 6: Permit System, Description of Internal Classes
When a servlet is invoked by the servlet engine (i.e. the client has requested the servlet by
selecting a hyperlink or pressing a button on one of the JSP pages), other methods from non
servlet classes are called by the servlet to perform the requested action. This could be storing
information to, or retrieving information from the database, for example. The servlet also
displays a result page, e.g. the confirmation that a database update was handled successfully,
or the contents of a retrieved database result set. A typical servlet doing this is shown below.
package Permit;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;
// Servlet class to list all companies.
public class CompanyList extends HttpServlet {
// doGet() Handles the HTTP request for listing all companies.
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
// Instantiate a string buffer to hold the generated HTML page.
StringBuffer str = new StringBuffer();
MyHTML.setApplicationPath(Global.PERMITURL);
// Start page output to the string buffer
// Insert the page header including the style sheet link
MyHTML.startPage(str,"List of All Companies","../style.css");
// Add the page banner
MyHTML.includeHTMLFile(str,"banner_permit.html");
// Add the Navigation Bar
67
Java Web Hosting Application Development Using Java Technologies Hosting
|
|
|
|
TotalRoute.net Business web hosting division of Vision Web Hosting Inc. All rights reserved. |