com.ibm.workflow.portlet.client
Class ResponsePage

java.lang.Object
  |
  +--com.ibm.workflow.portlet.client.ResponsePage

public final class ResponsePage
extends java.lang.Object

Objects of this class represent the responses sent by the Web Client. They are created by the various commandResponse methods of a Viewer.

To return a static HTML page use return ResponsePage(context, "/static.html");


Field Summary
static java.lang.String MIMETYPE_HTML
          Constant for text/html
static java.lang.String MIMETYPE_JPEG
          Constant for image/jpeg
static java.lang.String MIMETYPE_WML
          Constant for text/vnd.wap.wml
static java.lang.String MIMETYPE_XML
          Constant for text/xml
 
Constructor Summary
ResponsePage(byte[] contents, java.lang.String mimeType)
          Create a response page from a byte array.
ResponsePage(byte[] contents, java.lang.String mimeType, boolean followOnPageIsShown)
          Create a response page from a byte array.
ResponsePage(byte[] contents, java.lang.String mimeType, long date)
          Create a response page from a byte array.
ResponsePage(byte[] contents, java.lang.String mimeType, long date, boolean followOnPageIsShown)
          Create a response page from a byte array.
ResponsePage(int status)
          Create a response page from an HTTP status code.
ResponsePage(int status, boolean followOnPageIsShown)
          Create a response page from an HTTP status code.
ResponsePage(RequestContext context, java.lang.String urlname)
          Create a response page from a URL.
ResponsePage(RequestContext context, java.lang.String urlname, boolean followOnPageIsShown)
          Create a response page from a URL.
ResponsePage(RequestContext context, java.lang.String urlname, long date)
          Create a response page from a URL.
ResponsePage(RequestContext context, java.lang.String urlname, long date, boolean followOnPageIsShown)
          Create a response page from a URL.
ResponsePage(java.lang.StringBuffer contents)
          Create a response page from a StringBuffer.
ResponsePage(java.lang.StringBuffer contents, boolean followOnPageIsShown)
          Create a response page from a StringBuffer.
ResponsePage(java.lang.StringBuffer contents, java.lang.String mimeType)
          Create a response page from a StringBuffer.
ResponsePage(java.lang.StringBuffer contents, java.lang.String mimeType, boolean followOnPageIsShown)
          Create a response page from a StringBuffer.
ResponsePage(java.lang.StringBuffer contents, java.lang.String mimeType, long date)
          Create a response page from a StringBuffer.
ResponsePage(java.lang.StringBuffer contents, java.lang.String mimeType, long date, boolean followOnPageIsShown)
          Create a response page from a StringBuffer.
 
Method Summary
 boolean isFollowOnPageShown()
          Return flag indication whether a nontrivial page is shown.
 void setExpiryDate(long time)
          Set the expiry date of the reponse page.
 void setFollowOnPageShown(boolean isFollowOnPageShown)
          Set flag for the Portal Client which indicates that a nontrivial page will be shown.
 void setMimeType(java.lang.String mimeType)
          Set the MIME type of the reponse page.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIMETYPE_HTML

public static final java.lang.String MIMETYPE_HTML
Constant for text/html

MIMETYPE_XML

public static final java.lang.String MIMETYPE_XML
Constant for text/xml

MIMETYPE_WML

public static final java.lang.String MIMETYPE_WML
Constant for text/vnd.wap.wml

MIMETYPE_JPEG

public static final java.lang.String MIMETYPE_JPEG
Constant for image/jpeg
Constructor Detail

ResponsePage

public ResponsePage(int status)
Create a response page from an HTTP status code.
Parameters:
status - The HTTP status code to send.

ResponsePage

public ResponsePage(int status,
                    boolean followOnPageIsShown)
Create a response page from an HTTP status code.
Parameters:
status - The HTTP status code to send.
followOnPageIsShown - True if nontrivial page is shown

ResponsePage

public ResponsePage(java.lang.StringBuffer contents)
Create a response page from a StringBuffer. The default MIME type text/html will be used and the page will be set to expire immediately.
Parameters:
contents - The buffer containing the response.

ResponsePage

public ResponsePage(java.lang.StringBuffer contents,
                    boolean followOnPageIsShown)
Create a response page from a StringBuffer. The default MIME type text/html will be used and the page will be set to expire immediately.
Parameters:
contents - The buffer containing the response.
followOnPageIsShown - True if nontrivial page is shown

ResponsePage

public ResponsePage(java.lang.StringBuffer contents,
                    java.lang.String mimeType)
Create a response page from a StringBuffer. The page will be set to expire immediately.
Parameters:
contents - The buffer containing the response.
mimeType - The MIME type of the response.

ResponsePage

public ResponsePage(java.lang.StringBuffer contents,
                    java.lang.String mimeType,
                    boolean followOnPageIsShown)
Create a response page from a StringBuffer. The page will be set to expire immediately.
Parameters:
contents - The buffer containing the response.
mimeType - The MIME type of the response.
followOnPageIsShown - True if nontrivial page is shown

ResponsePage

public ResponsePage(java.lang.StringBuffer contents,
                    java.lang.String mimeType,
                    long date)
Create a response page from a StringBuffer.
Parameters:
contents - The buffer containing the response.
mimeType - The MIME type of the response.
date - The expiry date of the page

ResponsePage

public ResponsePage(java.lang.StringBuffer contents,
                    java.lang.String mimeType,
                    long date,
                    boolean followOnPageIsShown)
Create a response page from a StringBuffer.
Parameters:
contents - The buffer containing the response.
mimeType - The MIME type of the response.
date - The expiry date of the page
followOnPageIsShown - True if nontrivial page is shown

ResponsePage

public ResponsePage(byte[] contents,
                    java.lang.String mimeType)
Create a response page from a byte array. The page will be set to expire immediately.
Parameters:
contents - The buffer containing the response.
mimeType - The MIME type of the response.

ResponsePage

public ResponsePage(byte[] contents,
                    java.lang.String mimeType,
                    boolean followOnPageIsShown)
Create a response page from a byte array. The page will be set to expire immediately.
Parameters:
contents - The buffer containing the response.
mimeType - The MIME type of the response.
followOnPageIsShown - True if nontrivial page is shown

ResponsePage

public ResponsePage(byte[] contents,
                    java.lang.String mimeType,
                    long date)
Create a response page from a byte array.
Parameters:
contents - The buffer containing the response.
mimeType - The MIME type of the response.
date - The expiry date of the page

ResponsePage

public ResponsePage(byte[] contents,
                    java.lang.String mimeType,
                    long date,
                    boolean followOnPageIsShown)
Create a response page from a byte array.
Parameters:
contents - The buffer containing the response.
mimeType - The MIME type of the response.
date - The expiry date of the page
followOnPageIsShown - True if nontrivial page is shown

ResponsePage

public ResponsePage(RequestContext context,
                    java.lang.String urlname)
Create a response page from a URL. Note that this URL is relative to the servlet's document root directory. The context passed as parameter can then be accessed in the JSP using the following code:
   <jsp:useBean id="context" scope="request"
                type="com.ibm.workflow.servlet.client.RequestContext"/>
 
Parameters:
context - The context that was passed to the Viewer's commandResponse method. If null, the servlet will not directly invoke the page but rather send an HTTP redirect (status code 302) response.
urlname - The relative URL of the page to be sent as response. This can be either an HTML page or a JSP.

ResponsePage

public ResponsePage(RequestContext context,
                    java.lang.String urlname,
                    boolean followOnPageIsShown)
Create a response page from a URL. Note that this URL is relative to the servlet's document root directory. The context passed as parameter can then be accessed in the JSP using the following code:
   <jsp:useBean id="context" scope="request"
                type="com.ibm.workflow.servlet.client.RequestContext"/>
 
Parameters:
context - The context that was passed to the Viewer's commandResponse method. If null, the servlet will not directly invoke the page but rather send an HTTP redirect (status code 302) response.
urlname - The relative URL of the page to be sent as response. This can be either an HTML page or a JSP.
followOnPageIsShown - True if nontrivial page is shown

ResponsePage

public ResponsePage(RequestContext context,
                    java.lang.String urlname,
                    long date)
Create a response page from a URL. Note that this URL is relative to the servlet's document root directory. The context passed as parameter can then be accessed in the JSP using the following code:
   <jsp:useBean id="context" scope="request"
                type="com.ibm.workflow.servlet.client.RequestContext"/>
 
Parameters:
context - The context that was passed to the Viewer's commandResponse method. If null, the servlet will not directly invoke the page but rather send an HTTP redirect (status code 302) response.
urlname - The relative URL of the page to be sent as response. This can be either an HTML page or a JSP.
date - The expiry date of the page

ResponsePage

public ResponsePage(RequestContext context,
                    java.lang.String urlname,
                    long date,
                    boolean followOnPageIsShown)
Create a response page from a URL. Note that this URL is relative to the servlet's document root directory. The context passed as parameter can then be accessed in the JSP using the following code:
   <jsp:useBean id="context" scope="request"
                type="com.ibm.workflow.servlet.client.RequestContext"/>
 
Parameters:
context - The context that was passed to the Viewer's commandResponse method. If null, the servlet will not directly invoke the page but rather send an HTTP redirect (status code 302) response.
urlname - The relative URL of the page to be sent as response. This can be either an HTML page or a JSP.
date - The expiry date of the page
followOnPageIsShown - True if nontrivial page is shown
Method Detail

setMimeType

public void setMimeType(java.lang.String mimeType)
Set the MIME type of the reponse page. This method can be used to overwrite the default MIME type of text/html.
Parameters:
mimeType - The MIME type of the response page.

setExpiryDate

public void setExpiryDate(long time)
Set the expiry date of the reponse page.
Parameters:
date - The expiry date of the page

setFollowOnPageShown

public void setFollowOnPageShown(boolean isFollowOnPageShown)
Set flag for the Portal Client which indicates that a nontrivial page will be shown. A page is nontrivial
Parameters:
isFollowOnPageShown - Whether a nontrivial page is shown

isFollowOnPageShown

public boolean isFollowOnPageShown()
Return flag indication whether a nontrivial page is shown.
Returns:
Whether nontrivial page is shown.


© Copyright IBM Corporation 2002, 2007. All Rights Reserved.