List of usage examples for org.apache.wicket.request.http WebResponse sendError
public abstract void sendError(int sc, String msg);
From source file:com.comcast.cdn.traffic_control.traffic_monitor.publish.JsonPage.java
License:Apache License
/** * Send out the json!!!!/*from w w w . j ava 2 s.c o m*/ */ @Override public final void renderPage() { final MonitorConfig config = ConfigHandler.getConfig(); final WebResponse response = (WebResponse) super.getResponse(); response.setHeader("Access-Control-Allow-Origin", config.getAccessControlAllowOrigin()); try { final JSONObject jo = getJson(getPageParameters()); if (jo == null) { response.sendError(503, "Not ready"); return; } response.write(jo.toString(2)); } catch (JSONException e) { LOGGER.warn(e, e); } }