Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.voytechs.html.component
Class ServletFrame  view ServletFrame download ServletFrame.java

java.lang.Object
  extended bycom.voytechs.html.component.Component
      extended bycom.voytechs.html.component.SimpleComponent
          extended bycom.voytechs.html.component.Container
              extended bycom.voytechs.html.component.Frame
                  extended bycom.voytechs.html.component.ServletFrame

public class ServletFrame
extends Frame

A ServletFrame object is a adaptor for Servlets. Lets a servlet initialize the top level frame using servlet specific parameters. Lower level objects do not know that servlet is actually controlling the HTML output. Also additional HTML specific functions such as HTTP MIME headers and other servlet specific or servlet bound resources are defined by overriding lower level object methods.


Field Summary
private  com.voytechs.html.util.ServletAuthentication auth
           
private  javax.servlet.ServletConfig servletConfig
           
private  com.voytechs.html.event.ServletDispatcher servletDispatcher
           
private  java.lang.String servletName
           
private  java.lang.String servletPath
           
private  javax.servlet.http.HttpServletRequest servletRequest
           
private  javax.servlet.http.HttpServletResponse servletResponse
           
 
Fields inherited from class com.voytechs.html.component.Frame
 
Fields inherited from class com.voytechs.html.component.Container
 
Fields inherited from class com.voytechs.html.component.Component
COMPONENT_FLAG_DISPATCHABLE, COMPONENT_FLAG_FORM, COMPONENT_FLAG_INIT, COMPONENT_FLAG_SHOW, tagProperties
 
Constructor Summary
ServletFrame(java.lang.String servletName, java.lang.String servletPath, javax.servlet.ServletConfig servletConfig)
          Sets up a default Servlet compatible dispatcher.
ServletFrame(java.lang.String servletName, java.lang.String servletPath, javax.servlet.ServletConfig servletConfig, com.voytechs.html.event.ServletDispatcher dispatcher, com.voytechs.html.util.ServletAuthentication auth)
          Allows to set externaly defined dispatcher.
 
Method Summary
 void generateResponse(javax.servlet.http.HttpServletResponse res)
          This method is called by the servlet to generate a reponse to a HTTP request.
 java.lang.String getName()
          Returns the name of this servlet.
 java.lang.String getPath()
          Returns the directory path where the servlet is found/mapped by the web server.
 javax.servlet.ServletConfig getServletConfig()
          Returns the servlet config object passed to the servlet's init() method.
 javax.servlet.http.HttpServletRequest getServletRequest()
          Returns the current raw servlet request object passed to the servlet doGet() and doPost() methods.
 javax.servlet.http.HttpServletResponse getServletResponse()
          Returns the current raw servlet response object passed to the servlet doGet() and doPost() methods.
 void initTree()
          We are ready to finish initializing the component tree.
static void main(java.lang.String[] args)
          Test function for ServletFrame
 void postScan(javax.servlet.http.HttpServletResponse res)
          This method allows some kind of a post-paint scan accross the component tree if desired.
 void preScan(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          This method allows some kind of a pre-paint scan accross the component tree if desired.
 void scanServletRequest(javax.servlet.http.HttpServletRequest req)
          When a servlet is called to either doGet() or doPost(), this method is called to allow our GUI engine and especially the dispatcher scan all of the parameters passed from the client and dispatch events to listeners as appropriate.
 
Methods inherited from class com.voytechs.html.component.Frame
addElement, getAuthentication, getDispatcher, getUriPath, getUserName, isUserLoggedIn, loginPopup, paint, setUriPath
 
Methods inherited from class com.voytechs.html.component.Container
addChild, init, paintChildren, process, removeElement, toStringTree
 
Methods inherited from class com.voytechs.html.component.Component
areFlagsSet, clearFlags, getParent, getRootFrame, setFlags, setParent, show, show, toStringPrefix, toStringPrefixCap, toStringPrefixTee
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

servletDispatcher

private com.voytechs.html.event.ServletDispatcher servletDispatcher

servletConfig

private javax.servlet.ServletConfig servletConfig

servletName

private java.lang.String servletName

servletPath

private java.lang.String servletPath

servletRequest

private javax.servlet.http.HttpServletRequest servletRequest

servletResponse

private javax.servlet.http.HttpServletResponse servletResponse

auth

private com.voytechs.html.util.ServletAuthentication auth
Constructor Detail

ServletFrame

public ServletFrame(java.lang.String servletName,
                    java.lang.String servletPath,
                    javax.servlet.ServletConfig servletConfig)
Sets up a default Servlet compatible dispatcher.


ServletFrame

public ServletFrame(java.lang.String servletName,
                    java.lang.String servletPath,
                    javax.servlet.ServletConfig servletConfig,
                    com.voytechs.html.event.ServletDispatcher dispatcher,
                    com.voytechs.html.util.ServletAuthentication auth)
Allows to set externaly defined dispatcher.

Method Detail

getName

public java.lang.String getName()
Returns the name of this servlet.


getPath

public java.lang.String getPath()
Returns the directory path where the servlet is found/mapped by the web server.


getServletConfig

public javax.servlet.ServletConfig getServletConfig()
Returns the servlet config object passed to the servlet's init() method.


getServletRequest

public javax.servlet.http.HttpServletRequest getServletRequest()
Returns the current raw servlet request object passed to the servlet doGet() and doPost() methods.


getServletResponse

public javax.servlet.http.HttpServletResponse getServletResponse()
Returns the current raw servlet response object passed to the servlet doGet() and doPost() methods.


initTree

public void initTree()
              throws com.voytechs.html.event.EventException
We are ready to finish initializing the component tree. Needs to be called after the component tree is build and all of the components are bound to their parents.


scanServletRequest

public void scanServletRequest(javax.servlet.http.HttpServletRequest req)
                        throws javax.servlet.ServletException,
                               com.voytechs.html.event.EventException
When a servlet is called to either doGet() or doPost(), this method is called to allow our GUI engine and especially the dispatcher scan all of the parameters passed from the client and dispatch events to listeners as appropriate.


generateResponse

public void generateResponse(javax.servlet.http.HttpServletResponse res)
                      throws javax.servlet.ServletException,
                             java.io.IOException
This method is called by the servlet to generate a reponse to a HTTP request. The response is placed directly on the output stream found in the ServletResponse object. This is where the paint method of every GUI component is called to produce output on the output stream. The component tree is traversed and paint() of every component is called.


preScan

public void preScan(javax.servlet.http.HttpServletRequest req,
                    javax.servlet.http.HttpServletResponse res)
             throws javax.servlet.ServletException,
                    java.io.IOException
This method allows some kind of a pre-paint scan accross the component tree if desired. Other methods can be called from here before generateResponse() method is invoked.


postScan

public void postScan(javax.servlet.http.HttpServletResponse res)
              throws javax.servlet.ServletException,
                     java.io.IOException
This method allows some kind of a post-paint scan accross the component tree if desired. Other methods can be called from here after generateResponse() method is invoked.


main

public static void main(java.lang.String[] args)
Test function for ServletFrame