HQU Render Method
Once a controller finishes, it usually needs to render content to the browser. The render() method, provided in RenderFrame.groovy provides this functionality.
Rendering a JSON result
Returning JSON to the browser is a simple task. Simply inform the BaseController which methods should have their results translated to JSON.
import org.hyperic.hq.hqu.rendit.BaseController
class ThrashController extends BaseController {
def ThrashController() {
setJSONMethods(['compressData', 'dbAnalyze'])
}
def compressData(params) {
[ compressTime: SomeManager.compressSomething(),
mood: 'Grumpy' ]
}
}
The above will allow a caller to execute the compressData method and get back a JSON result. http://localhost:7080/hqu/coolplugin/thrash/compressData.hqu