pl.aislib.fm
Class PageResponse

java.lang.Object
  extended bypl.aislib.fm.PageResponse

public class PageResponse
extends java.lang.Object

Class encapsulating response from the Page.getPageResponse() method. Page Response should be in one of the main forms:

Second type of response will be processed by Application class methods (substituted into proper template) and send to Client.

Note:
Map given as argument for some of the constructors should always contain pair ('page', Action Key for Page creating this response). If such a Map will not contain this pair, we will modify it and add appropriate pair.

Since:
AISLIB 0.1
Version:
$Revision: 1.3 $
Author:
Tomasz Pik, AIS.PL
Michal Jastak, AIS.PL

Constructor Summary
PageResponse(Page page)
          Sole constructor for empty response.
PageResponse(Page page, byte[] content, java.lang.String contentType)
          Constructor for raw type response.
PageResponse(Page page, java.util.Map content)
          Constructor for (key, value) type response.
PageResponse(Page page, java.util.Map content, java.lang.String contentType)
          Constructor for (key, value) type response, using specified content type for response.
 
Method Summary
 byte[] getContentByte()
          Returns raw response content if any.
 java.util.Map getContentMap()
          Returns response (key, value) mapping if any.
 java.lang.String getContentType()
          Returns response content type.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PageResponse

public PageResponse(Page page)
Sole constructor for empty response.

Parameters:
page - Page creating this response.

PageResponse

public PageResponse(Page page,
                    byte[] content,
                    java.lang.String contentType)
Constructor for raw type response.

Parameters:
page - Page creating this response.
content - raw content of response written as byte table.
contentType - content type of response.

PageResponse

public PageResponse(Page page,
                    java.util.Map content)
Constructor for (key, value) type response.

Parameters:
page - Page creating this response.
content - response written as (key, value) mapping.

PageResponse

public PageResponse(Page page,
                    java.util.Map content,
                    java.lang.String contentType)
Constructor for (key, value) type response, using specified content type for response.

Parameters:
page - Page creating this response.
content - response written as (key, value) mapping.
contentType - content type of response.
Method Detail

getContentType

public java.lang.String getContentType()
Returns response content type.

Returns:
response content type (default "text/html").

getContentMap

public java.util.Map getContentMap()
Returns response (key, value) mapping if any.

Returns:
response as (key, value) mapping or null if not available

getContentByte

public byte[] getContentByte()
Returns raw response content if any.

Returns:
raw response content as byte table or null if not available

toString

public java.lang.String toString()
See Also:
Object.toString()


Copyright © 2002-2005 AIS.PL. All Rights Reserved.