public JSONObject toJSON() { JSONObject spec = new JSONObject(); try { spec.put("x", x); spec.put("y", y); } catch (JSONException ex) { LoggerService.log(ex); } return spec; }
public void redirect(String location) { try { FacesContext ctx = FacesContext.getCurrentInstance(); ExternalContext extContext = ctx.getExternalContext(); String url = extContext.encodeActionURL( ctx.getApplication().getViewHandler().getActionURL(ctx, location)); extContext.redirect(url); } catch (IOException ex) { LoggerService.log(ex); } catch (java.lang.IllegalStateException ex) { } }
@PostConstruct public void init() { LoggerService.setApplicationName("OpenIoT:RequestPresentation"); LoggerService.setLevel(Level.FINE); LoggerService.log(Level.INFO, "Initializing"); }