Klasse JSONScreen
- Bekannte direkte Unterklassen:
JSONSecureScreen
Here is an example from a superclass:
public void doOutput(PipelineData data) throws Exception
{
User user = data.getUser();
MyJsonFunctions myFunctions = new MyJsonFunctions(user.getName());
// Session specific
TurbineJsonRpc.registerObject(data.getSession(), "myFunctions", myFunctions);
// Global
//TurbineJsonRpc.registerObjectGlobal("testGlobal", testObject);
super.doOutput(data);
}
The class MyFunctions would be something like:
public class MyJsonFunctions
{
private String getHello(String clientParameter)
{
return "Hello " + clientParameter;
}
}
This code is derived from the com.metaparadigm.jsonrpc.JSONRPCServlet and (after upgrade) checked against org.jabsorb.JSONRPCServlet.
- Version:
- $Id$
- Autor:
- brad@folkens.com, Scott Eade
-
Feldübersicht
Modifizierer und TypFeldBeschreibungprotected static final int
protected static final String
protected JsonRpcService
Injected service instanceVon Schnittstelle geerbte Felder org.apache.turbine.modules.Screen
CACHE_SIZE_DEFAULT, CACHE_SIZE_KEY, NAME, PREFIX
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected void
doOutput
(PipelineData pipelineData) Output the dynamic content.protected String
getContentType
(PipelineData pipelineData) Set the content type.
-
Felddetails
-
JSONRPC_CONTENT_TYPE
- Siehe auch:
-
BUFFER_SIZE
- Siehe auch:
-
jsonRpcService
Injected service instance
-
-
Konstruktordetails
-
JSONScreen
public JSONScreen()
-
-
Methodendetails
-
getContentType
Beschreibung aus Klasse kopiert:RawScreen
Set the content type. This method should be overridden to actually set the real content-type header of the output.- Angegeben von:
getContentType
in KlasseRawScreen
- Parameter:
pipelineData
- Turbine information.- Gibt zurück:
- A String with the content type.
- Siehe auch:
-
doOutput
Output the dynamic content. Encoding is UTF-8. @JSONRPC_CONTENT_TYPE
: "application/json;charset=utf-8".
-