Klasse JSONResponse

java.lang.Object
org.apache.sling.servlets.post.AbstractPostResponse
org.apache.sling.servlets.post.JSONResponse
Alle implementierten Schnittstellen:
PostResponse

@Deprecated public class JSONResponse extends AbstractPostResponse
Veraltet.
Use JakartaJSONResponse instead.
The JSONResponse is an AbstractPostResponse preparing the response in JSON.
  • Felddetails

  • Konstruktordetails

    • JSONResponse

      public JSONResponse()
      Veraltet.
  • Methodendetails

    • onChange

      public void onChange(String type, String... arguments)
      Veraltet.
      Beschreibung aus Schnittstelle kopiert: PostResponse
      Records a generic change of the given type with arguments.
      Parameter:
      type - The type of the modification
      arguments - The arguments to the modifications
    • setError

      public void setError(Throwable error)
      Veraltet.
      Beschreibung aus Schnittstelle kopiert: PostResponse
      Sets the recorded error causing the operation to fail.
      Angegeben von:
      setError in Schnittstelle PostResponse
      Setzt außer Kraft:
      setError in Klasse AbstractPostResponse
      Parameter:
      error - the throwable
    • getError

      public Throwable getError()
      Veraltet.
      Beschreibung aus Klasse kopiert: AbstractPostResponse
      Returns any recorded error or null
      Angegeben von:
      getError in Schnittstelle PostResponse
      Setzt außer Kraft:
      getError in Klasse AbstractPostResponse
      Gibt zurück:
      an error or null
    • setProperty

      public void setProperty(String name, Object value)
      Veraltet.
      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:
      setProperty in Klasse AbstractPostResponse
      Parameter:
      name - name of the property
      value - value of the property - either of type {String, Boolean, Number, null} or the toString() is parseable as json
      Löst aus:
      JSONResponse.JSONResponseException - if the value is not usable
    • getProperty

      public Object getProperty(String name)
      Veraltet.
      Beschreibung aus Klasse kopiert: AbstractPostResponse
      Returns the generic response property with the given name and type or null if no such property exists.
      Setzt außer Kraft:
      getProperty in Klasse AbstractPostResponse
      Parameter:
      name - the name of the response property
      Gibt zurück:
      the requested property (might be null)
    • doSend

      protected void doSend(javax.servlet.http.HttpServletResponse response) throws IOException
      Veraltet.
      Angegeben von:
      doSend in Klasse AbstractPostResponse
      Löst aus:
      IOException