org.javaWebGen
Class FrameworkController

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.javaWebGen.FrameworkController
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class FrameworkController
extends javax.servlet.http.HttpServlet

Main application Servlet Controller is a traffic controller that calls on classes that implement the WebController class to do all the work. Someday I will get around to changing it to a filter. This class should be removed. It was used a dynamic class loader like the Ruby on Rails framework. I think this is a bad idea allowing a url to determine directly what class it can call! Instead it is safer to declare the URL to WebController mapping in an XML ahead of time.

Author:
Kevin Scott
See Also:
Serialized Form

Field Summary
static java.lang.String ERROR_PAGE
           
static java.lang.String JSON
           
static java.lang.String JSON_MIME
           
 java.util.HashMap<java.lang.String,WebController> mapping
           
static java.lang.String PAGE
           
static java.lang.String SOAP
           
static java.lang.String SOAP_MIME
           
static java.lang.String VIEW
           
 
Constructor Summary
FrameworkController()
           
 
Method Summary
 void init(javax.servlet.ServletConfig config)
          read config file location if it exists xml file location
 void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Main web controller entry point calls a registered Web Controller based on a req.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PAGE

public static final java.lang.String PAGE
See Also:
Constant Field Values

ERROR_PAGE

public static final java.lang.String ERROR_PAGE
See Also:
Constant Field Values

mapping

public java.util.HashMap<java.lang.String,WebController> mapping

JSON

public static final java.lang.String JSON
See Also:
Constant Field Values

SOAP

public static final java.lang.String SOAP
See Also:
Constant Field Values

VIEW

public static final java.lang.String VIEW
See Also:
Constant Field Values

SOAP_MIME

public static final java.lang.String SOAP_MIME
See Also:
Constant Field Values

JSON_MIME

public static final java.lang.String JSON_MIME
See Also:
Constant Field Values
Constructor Detail

FrameworkController

public FrameworkController()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
read config file location if it exists xml file location

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
config -
Throws:
javax.servlet.ServletException

service

public void service(javax.servlet.http.HttpServletRequest req,
                    javax.servlet.http.HttpServletResponse res)
             throws javax.servlet.ServletException,
                    java.io.IOException
Main web controller entry point calls a registered Web Controller based on a req. parm called page(page=) jumps to a URL returned by the WebController

Overrides:
service in class javax.servlet.http.HttpServlet
Parameters:
req -
res -
Throws:
javax.servlet.ServletException
java.io.IOException


Copyright(C) 2003-2006 Kevin Scott - All Rights Reserved.