Attempt to retrieve an instance of JSONObject from WebWork's ValueStack through property returned from #getJSONObjectProperty() and write the String representation of the retrived JSONObject to HttpServletResponse's outputstream. Normally having accessor methods for the property in WebWork's action would do the trick.

Parameters

  • contentType - Defines the content-type header to be used. Default to 'application/json'
  • jsonObjectProperty - Defines the property used to look up WebWork's ValueStack to find an instance of JSONObject. Default to 'jsonObject'.

Examples

<action name="getActiveCustomers" class="...">
     <result name="success" type="json">
         <param name="jsonObjectProperty">activeCustomer</param>
         <param name="contentType">application/json</param>
     </result>
     ...
 </action>>

 Or just

 <action name="getActiveCustomers" class="...">
     <result name="success" type="json" />
     ...
 </action>

 if we used the default property ('jsonObject') and default content-type ('application/json')