org.javaWebGen
Class WebController

java.lang.Object
  extended by org.javaWebGen.WebController
Direct Known Subclasses:
LoginController

public abstract class WebController
extends java.lang.Object

Title: WebController

Description: Generic Web based controller that should be extended to process web forms using the correct model classes for the business logic

Version:
$Revision: 1.0 $
Author:
Kevin Scott

Field Summary
static java.lang.String SOAP_BODY
           
static java.lang.String SOAP_FOOTER
           
static java.lang.String SOAP_HEADER
           
 
Constructor Summary
WebController()
           
 
Method Summary
protected  java.lang.String doJSON(javax.servlet.http.HttpServletRequest req)
          returns JSON results to the caller
protected  java.lang.String doSOAP(javax.servlet.http.HttpServletRequest req)
          returns SOAP XML results to the caller
abstract  java.lang.String exec(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
           
static java.lang.String getCmd(javax.servlet.http.HttpServletRequest req)
          get the current command passed on the request
protected static java.lang.Object getFormBean(javax.servlet.http.HttpServletRequest req)
          get the request page on the request
static java.lang.String getPage(javax.servlet.http.HttpServletRequest req)
          get the request page on the request
protected  javax.servlet.http.HttpSession getSession(javax.servlet.http.HttpServletRequest req)
          return current session
protected  WebSession getWebSession(javax.servlet.http.HttpSession session)
          get WebSession object from session
 boolean valSession(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, javax.servlet.http.HttpSession session)
          validate Session and check login etc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOAP_HEADER

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

SOAP_FOOTER

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

SOAP_BODY

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

WebController

public WebController()
Method Detail

exec

public abstract java.lang.String exec(javax.servlet.http.HttpServletRequest req,
                                      javax.servlet.http.HttpServletResponse res)
                               throws WebAppException
Parameters:
req -
res -
Returns:
url to jump to
Throws:
WebAppException

getWebSession

protected WebSession getWebSession(javax.servlet.http.HttpSession session)
get WebSession object from session

Parameters:
session -
Returns:
web session

getSession

protected javax.servlet.http.HttpSession getSession(javax.servlet.http.HttpServletRequest req)
return current session

Parameters:
req -
Returns:
current session

valSession

public boolean valSession(javax.servlet.http.HttpServletRequest req,
                          javax.servlet.http.HttpServletResponse res,
                          javax.servlet.http.HttpSession session)
validate Session and check login etc

Parameters:
req -
session -
Returns:
true or false

getCmd

public static java.lang.String getCmd(javax.servlet.http.HttpServletRequest req)
get the current command passed on the request

Parameters:
req - request
Returns:
cmd string

getPage

public static java.lang.String getPage(javax.servlet.http.HttpServletRequest req)
get the request page on the request

Parameters:
req - request
Returns:
page string

getFormBean

protected static java.lang.Object getFormBean(javax.servlet.http.HttpServletRequest req)
get the request page on the request

Parameters:
req - request
Returns:
page string

doJSON

protected java.lang.String doJSON(javax.servlet.http.HttpServletRequest req)
                           throws javax.servlet.ServletException
returns JSON results to the caller

Returns:
JSON text
Throws:
error
javax.servlet.ServletException

doSOAP

protected java.lang.String doSOAP(javax.servlet.http.HttpServletRequest req)
                           throws javax.servlet.ServletException
returns SOAP XML results to the caller

Returns:
SOAP xml text
Throws:
error
javax.servlet.ServletException


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