IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.cs.html
Class HtmlPresentationHandler

java.lang.Object
  extended by com.ibm.btt.clientserver.DSEPresentationHandler
      extended by com.ibm.btt.cs.html.HtmlPresentationHandler
All Implemented Interfaces:
PresentationHandler

public class HtmlPresentationHandler
extends DSEPresentationHandler

Forward responses from the Html Client component to the client browser. Responses are forwarded to either the reply page or the error page as specified by the completed operation context or by information saved in the HttpServletRequest by the toolkit.


Field Summary
 
Fields inherited from class com.ibm.btt.clientserver.DSEPresentationHandler
javaClientException, javaClientTrace
 
Constructor Summary
HtmlPresentationHandler()
          HtmlPresentationHandler default constructor.
 
Method Summary
 void addFieldTo(Context ctx, java.lang.String name, java.lang.Object value)
          This method adds toolkit related fields to a context.
protected  void addRequiredDataToSessionCtx(java.lang.String sessionId, javax.servlet.http.HttpServletRequest req)
          The session context requires some data to be added to it.
protected  void clearUp(javax.servlet.http.HttpServletRequest req)
           Clean up context and session after forwarded JSP
protected  void forward(java.lang.String replyPageName, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, ChannelContext channelContext)
          Obtains a RequestDispatcher for the replyPageName passed in and forwards the response to this page.
protected  javax.servlet.http.HttpServletRequest getOrgRequest(ChannelContext channelContext)
           
protected  javax.servlet.http.HttpServletResponse getOrgResponse(ChannelContext channelContext)
           
protected  RequestValidationServices getRVS(ChannelContext cc)
          Returns the RequestValidationServices instance associated with the current session.
protected  java.lang.String getSessionId(ChannelContext aChannelContext)
          Obtains the session id from the channel context.
 void handleException(ChannelContext channelContext, java.lang.Exception e)
          When an error occurs attempting to return to the client browser, it may not be possible to return the error.
 void processException(ChannelContext channelContext, java.lang.Exception exception)
          Obtain the error page name from DSE.INI settings and forward the response to that page.
 void processReply(ChannelContext channelContext, java.lang.Object operation)
          Obtain the name of the page to display and forward the request to that page.
 
Methods inherited from class com.ibm.btt.clientserver.DSEPresentationHandler
handleException, processSessionReply, usingCookies
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlPresentationHandler

public HtmlPresentationHandler()
HtmlPresentationHandler default constructor.

Method Detail

addFieldTo

public void addFieldTo(Context ctx,
                       java.lang.String name,
                       java.lang.Object value)
                throws java.lang.Exception
This method adds toolkit related fields to a context.

Throws:
java.lang.Exception

addRequiredDataToSessionCtx

protected void addRequiredDataToSessionCtx(java.lang.String sessionId,
                                           javax.servlet.http.HttpServletRequest req)
The session context requires some data to be added to it.

Parameters:
sessionId - java.lang.String
req - HttpServletRequest

forward

protected void forward(java.lang.String replyPageName,
                       javax.servlet.http.HttpServletRequest req,
                       javax.servlet.http.HttpServletResponse res,
                       ChannelContext channelContext)
Obtains a RequestDispatcher for the replyPageName passed in and forwards the response to this page. Once forwarded the page, this method flushes the buffer in order to force the launching of an exception if other request from same client is in process. Doing so double clicks are detected. The entry in the pendingRequestsTable is updated to let further requests notice that they are product of abnormal navigation.

Parameters:
replyPageName - java.lang.String The name of the page to be forwarded
req - javax.servlet.HttpServletRequest Request object
res - javax.servlet.HttpServletResponse Response object
channelContext - com.ibm.btt.clientserver.ChannelContext

getRVS

protected RequestValidationServices getRVS(ChannelContext cc)
                                    throws DSEException
Returns the RequestValidationServices instance associated with the current session.

Parameters:
cc - com.ibm.btt.clientserver.ChannelContext ChannelContext used to get the session
Returns:
RequestValidationServices RequestValidationServices object associated with given session
Throws:
DSEException - Either it is not possible to retrieve a sessionId from the channelContext or there is no session associated with the sessionId.

getSessionId

protected java.lang.String getSessionId(ChannelContext aChannelContext)
Obtains the session id from the channel context. Returns the sessionId or null if there is no sessionId associated with this ChannelContext.

Parameters:
aChannelContext - com.ibm.btt.clientserver.ChannelContext
Returns:
java.lang.String

clearUp

protected void clearUp(javax.servlet.http.HttpServletRequest req)
Clean up context and session after forwarded JSP


handleException

public void handleException(ChannelContext channelContext,
                            java.lang.Exception e)
When an error occurs attempting to return to the client browser, it may not be possible to return the error. If we have access to an HtmlServletResponse, we will use it. Otherwise we just record the error to the System.err stream.

Parameters:
channelContext - com.ibm.btt.clientserver.ChannelContext
e - java.lang.Exception

processException

public void processException(ChannelContext channelContext,
                             java.lang.Exception exception)
Obtain the error page name from DSE.INI settings and forward the response to that page.

Specified by:
processException in interface PresentationHandler
Overrides:
processException in class DSEPresentationHandler
Parameters:
channelContext - com.ibm.btt.clientserver.ChannelContext
e - java.lang.Exception

processReply

public void processReply(ChannelContext channelContext,
                         java.lang.Object operation)
Obtain the name of the page to display and forward the request to that page.

Specified by:
processReply in interface PresentationHandler
Overrides:
processReply in class DSEPresentationHandler
Parameters:
channelContext - com.ibm.btt.clientserver.ChannelContext
operation - com.ibm.btt.base.ServerOperation

getOrgRequest

protected javax.servlet.http.HttpServletRequest getOrgRequest(ChannelContext channelContext)

getOrgResponse

protected javax.servlet.http.HttpServletResponse getOrgResponse(ChannelContext channelContext)

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2009