java.lang.Object
com.voytechs.html.component.Component
com.voytechs.html.component.SimpleComponent
com.voytechs.html.component.Container
com.voytechs.html.component.Frame
com.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.
| Fields inherited from class com.voytechs.html.component.Frame |
|
| Fields inherited from class com.voytechs.html.component.Container |
|
| 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 |
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
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.
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