com.groiss.gui
Class JSONPage

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

public class JSONPage
extends java.lang.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(java.lang.Object jsonContent)
          Initializes an instance of this class using the final content in JSON form.
 
Method Summary
 java.lang.String getContentType()
          Returns the content type of the page, for example "test/html".
 java.lang.String show()
          Called from the Dispatcher.
 void writeTo(javax.servlet.http.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(java.lang.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 java.lang.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 java.lang.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(javax.servlet.http.HttpServletResponse res)
             throws java.io.IOException
Write page in response, and add specific to json headers

Parameters:
res -
Throws:
java.io.IOException


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.