Package org.apache.sling.servlets.post
Klasse JakartaJSONResponse
java.lang.Object
org.apache.sling.servlets.post.AbstractJakartaPostResponse
org.apache.sling.servlets.post.JakartaJSONResponse
- Alle implementierten Schnittstellen:
JakartaPostResponse
The
JSONResponse is an AbstractJakartaPostResponse preparing
the response in JSON.- Seit:
- 2.5.0
-
Verschachtelte Klassen - Übersicht
Verschachtelte Klassen -
Feldübersicht
FelderVon Klasse geerbte Felder org.apache.sling.servlets.post.AbstractJakartaPostResponse
PN_ERROR, PN_IS_CREATED, PN_LOCATION, PN_PARENT_LOCATION, PN_PATH, PN_REFERER, PN_STATUS_CODE, PN_STATUS_MESSAGE, PN_TITLE -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected voiddoSend(jakarta.servlet.http.HttpServletResponse response) getError()Returns any recorded error ornullgetProperty(String name) Returns the generic response property with the given name and type ornullif no such property exists.voidRecords a generic change of the giventypewith arguments.voidSets the recorded error causing the operation to fail.voidsetProperty(String name, Object value) This method accepts values that correspond to json primitives or otherwise assumes that the toString() of the value can be parsed as json.Von Klasse geerbte Methoden org.apache.sling.servlets.post.AbstractJakartaPostResponse
getLocation, getParentLocation, getPath, getProperty, getReferer, getStatusCode, getStatusMessage, isCreateRequest, isSafeReferer, isSuccessful, onCopied, onCreated, onDeleted, onModified, onMoved, send, setCreateRequest, setLocation, setParentLocation, setPath, setReferer, setStatus, setTitle
-
Felddetails
-
RESPONSE_CONTENT_TYPE
- Siehe auch:
-
-
Konstruktordetails
-
JakartaJSONResponse
public JakartaJSONResponse()
-
-
Methodendetails
-
onChange
Beschreibung aus Schnittstelle kopiert:JakartaPostResponseRecords a generic change of the giventypewith arguments.- Parameter:
type- The type of the modificationarguments- The arguments to the modifications
-
setError
Beschreibung aus Schnittstelle kopiert:JakartaPostResponseSets the recorded error causing the operation to fail.- Angegeben von:
setErrorin SchnittstelleJakartaPostResponse- Setzt außer Kraft:
setErrorin KlasseAbstractJakartaPostResponse- Parameter:
error- the throwable
-
getError
Beschreibung aus Klasse kopiert:AbstractJakartaPostResponseReturns any recorded error ornull- Angegeben von:
getErrorin SchnittstelleJakartaPostResponse- Setzt außer Kraft:
getErrorin KlasseAbstractJakartaPostResponse- Gibt zurück:
- an error or
null
-
setProperty
This method accepts values that correspond to json primitives or otherwise assumes that the toString() of the value can be parsed as json. If neither is the case it will throw an Exception. Assuming the above holds, it will put the value as json directly into the json value part of the response.- Setzt außer Kraft:
setPropertyin KlasseAbstractJakartaPostResponse- Parameter:
name- name of the propertyvalue- value of the property - either of type {String, Boolean, Number, null} or the toString() is parseable as json- Löst aus:
JakartaJSONResponse.JSONResponseException- if the value is not usable
-
getProperty
Beschreibung aus Klasse kopiert:AbstractJakartaPostResponseReturns the generic response property with the given name and type ornullif no such property exists.- Setzt außer Kraft:
getPropertyin KlasseAbstractJakartaPostResponse- Parameter:
name- the name of the response property- Gibt zurück:
- the requested property (might be null)
-
doSend
- Angegeben von:
doSendin KlasseAbstractJakartaPostResponse- Löst aus:
IOException
-