|
IBM Branch Transformation Toolkit Javadoc | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.ibm.btt.cs.servlet.CSReqServlet
The CSReqServlet implements the ChannelDriver interface to define the front door for all devices supporting the HTTP protocol. For this example, the parent context for allworkstation contexts is the "root" context.
This class implements HTTP specific behavior for saving the information associated with a session into a database using the HttpSession class supplied by WebSphere Application Server. To use the data persistence you must set the value of the tag "channelHandlers.html.requestHandler" of the dse.ini file to:
com.ibm.btt.cs.html.ext.PersistHtmlRequestHandler
It is also possible to specify whether session affinity exists using the initialization.sessionAffinity tag in the dse.ini file. By default, session affinity is assumed. To specify that there is no session affinity, set the tag's value to "no" (or "false", or "0", or "disable" ). To use this feature, you must activate the persistence of the session in the WebSphere Application Server. For more information, see the WebSphere documentation.
Field Summary | |
---|---|
protected static java.util.ResourceBundle |
javaClientException
|
protected static java.util.ResourceBundle |
javaClientTrace
Trace File for NLS |
Constructor Summary | |
---|---|
CSReqServlet()
CSServlet constructor. |
Method Summary | |
---|---|
ChannelContext |
createChannelContext(java.lang.Object req,
java.lang.Object res,
java.lang.Object driver)
Creates a ChannelContext object with the req, res, and driver attributes. |
void |
createChannelHandler(ChannelContext channelContext)
Creates a ChannelHandler object with the channelContext attribute and caches the ChannelHandler into the HandlerRegistry singleton. |
protected void |
getDeviceType(ChannelContext channelContext)
Determines the device type for the handler and adds to the ChannelContext object. |
protected PresentationHandler |
getPresentationHandler(ChannelContext channelContext)
Determines the PresentationHandler to invoke for the specific channel driver and obtains the presenation handler from the HandlerRegistry. |
protected RequestHandler |
getRequestHandler(ChannelContext channelContext)
Determines the RequestHandler to invoke for the specific channel driver and obtains the request handler from the HandlerRegistry. |
protected void |
handleException(ChannelContext channelContext,
java.lang.Exception ex)
Invokes the presentation handler to pass the exception to the client. |
protected void |
handleException(java.lang.Exception ex)
Logs the exception with the framwework trace facility. |
protected void |
handleServerResponse(ChannelContext channelContext,
java.lang.Exception e)
Convenience method to ensure that a response is returned to the client for the case where no presentation handler exists or because the server is not initialized. |
void |
parseRequestData(ChannelContext channelContext)
Parses the contents of the parameters contained in the HttpServletRequest, parses the request data into the KeyedCollection, and adds the kColl into the ChannelContext request data. |
void |
parseRequestHeader(ChannelContext channelContext)
Parses the contents of the header contained in the HttpServletRequest, parses the request header into the KeyedCollection, and adds the kColl into the ChannelContext request data. |
void |
preProcessRequest(ChannelContext channelContext)
Performs any session management/control required at the device level. |
protected boolean |
runInSession(ChannelContext channelContext)
Determines from the HandlerRegistry whether the device type should run in a session. |
protected void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Defines the process flow to execute a request. |
protected void |
updateChannelHandler(ChannelHandler ch,
java.lang.String key,
java.lang.String value)
Performs special processing for the channel specific parameters in the server dse.ini file to instantiate the instances of the PresentationHandler and RequestHandler. |
protected boolean |
usingCookies(ChannelContext channelContext)
Determines from the HandlerRegistry whether the device type is using cookies to manage the session. |
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, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static java.util.ResourceBundle javaClientTrace
protected static java.util.ResourceBundle javaClientException
Constructor Detail |
public CSReqServlet()
Method Detail |
public ChannelContext createChannelContext(java.lang.Object req, java.lang.Object res, java.lang.Object driver)
createChannelContext
in interface ChannelDriver
req
- java.lang.Objectres
- java.lang.Objectdriver
- java.lang.Object
public void createChannelHandler(ChannelContext channelContext) throws java.lang.Exception
createChannelHandler
in interface ChannelDriver
channelContext
- com.ibm.btt.clientserver.ChannelContext
java.lang.Exception
protected void getDeviceType(ChannelContext channelContext) throws DSENoRegisteredDeviceTypeException
channelContext
- com.ibm.btt.clientserver.ChannelContext
DSENoRegisteredDeviceTypeException
protected PresentationHandler getPresentationHandler(ChannelContext channelContext) throws DSENoRegisteredPresentationHandlerException
channelContext
- com.ibm.btt.clientserver.ChannelContext
DSENoRegisteredRequestHandlerException
DSENoRegisteredPresentationHandlerException
protected RequestHandler getRequestHandler(ChannelContext channelContext) throws DSENoRegisteredRequestHandlerException
channelContext
- com.ibm.btt.clientserver.ChannelContext
DSENoRegisteredRequestHandlerException
protected void handleException(ChannelContext channelContext, java.lang.Exception ex)
channelContext
- com.ibm.btt.clientserver.ChannelContextex
- java.lang.Exception Thrown if the server is unable to process a responseprotected void handleException(java.lang.Exception ex)
ex
- java.lang.Exceptionprotected void handleServerResponse(ChannelContext channelContext, java.lang.Exception e) throws java.lang.Exception
channelContext
- com.ibm.btt.clientserver.ChannelContexte
-
java.lang.Exception
- The exception description.public void parseRequestData(ChannelContext channelContext) throws java.lang.Exception
Override this method to modify the the data parsing behavior.
parseRequestData
in interface ChannelDriver
channelContext
- com.ibm.btt.clientserver.ChannelContext
java.lang.Exception
public void parseRequestHeader(ChannelContext channelContext) throws java.lang.Exception
Override this method to modify the the data parsing behavior.
parseRequestHeader
in interface ChannelDriver
channelContext
- com.ibm.btt.clientserver.ChannelContext
java.lang.Exception
public void preProcessRequest(ChannelContext channelContext) throws DSECSSessionNotEstablishedException
preProcessRequest
in interface ChannelDriver
channelContext
- com.ibm.btt.clientserver.ChannelContext
DSECSSessionNotEstablishedException
- Thrown if the session has expiredprotected boolean runInSession(ChannelContext channelContext) throws DSECSSessionNotEstablishedException
channelContext
- com.ibm.btt.clientserver.ChannelContext
DSECSSessionNotEstablishedException
protected void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, java.io.IOException
req
- HttpServletRequestres
- HttpServletResponse
javax.servlet.ServletException
java.io.IOException
protected void updateChannelHandler(ChannelHandler ch, java.lang.String key, java.lang.String value) throws java.lang.Exception
ch
- com.ibm.btt.clientserver.ChannelHandlerkey
- java.lang.Stringvalue
- java.lang.String
java.lang.Exception
protected boolean usingCookies(ChannelContext channelContext)
channelContext
- com.ibm.btt.clientserver.ChannelContext
|
IBM Branch Transformation Toolkit Javadoc | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |