com.groiss.gui
Class JSONPage

java.lang.Object
  extended by com.groiss.gui.JSONPage
All Implemented Interfaces:
Page

public class JSONPage
extends Object
implements Page

Implementation of the Page, that is used to send a JSON (JavaScript Object Notation) content back to the browser. Used for Ajax based requests.


Constructor Summary
JSONPage(Object jsonContent)
          Initializes an instance of this class using the final content in JSON form.
 
Method Summary
 String getContentType()
          Returns the content type of the page, for example "test/html".
 String show()
          Called from the Dispatcher.
 void writeTo(HttpServletResponse res)
          Write page in response, and add specific to json headers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSONPage

public JSONPage(Object jsonContent)
Initializes an instance of this class using the final content in JSON form.

Parameters:
jsonContent - the response content in JSON form
Method Detail

getContentType

public String getContentType()
Description copied from interface: Page
Returns the content type of the page, for example "test/html".

Specified by:
getContentType in interface Page
Returns:
the contents mime type as String

show

public String show()
Description copied from interface: Page
Called from the Dispatcher. Returns a String representation suitable for viewing in the browser (HTML, XHTML, plain text, etc.)

Specified by:
show in interface Page

writeTo

public void writeTo(HttpServletResponse res)
             throws IOException
Write page in response, and add specific to json headers

Parameters:
res -
Throws:
IOException


@enterprise 8.0.10809 Copyright © 2001-2012 Groiss Informatics GmbH. All Rights Reserved.