/** * Create an url from url components * @param parts components to join * @return an url string */ public String url(String... parts) { return ujoin(context().prefix, parts); }
/** * Get the cookies * @return the cookies map */ public Map<String, Cookie> cookies() { return context().cookies(); }
/** * Create an url from url components * @param parts components to join * @return an url string */ public String url(String... parts) { return ujoin(context().prefix, parts); }
/** * Create an url from url components * @param parts components to join * @return an url string */ public String url(String... parts) { return ujoin(context().prefix, parts); }
public void setStatus(int status) { context().setStatus(status); }
/** * Get the cookies * @return the cookies map */ public Map<String, Cookie> cookies() { return context().cookies(); }
/** * Get the cookies * @return the cookies map */ public Map<String, Cookie> cookies() { return context().cookies(); }
/** * Convenience method for REST APIs (without explicit views) * @param object - the object as the response (in JSON) */ protected void renderJSON(Object object) { LOG.debug("{}: {}", MimeType.JSON, object); context().rendered = true; context().response.setContentType(MimeType.JSON); try { jsonMapper.writeValue(writer(), object); } catch (Exception e) { throw new WebAppException(e); } }
public void setStatus(int status) { context().setStatus(status); }
public String get(String key, String defaultValue) { return context().get(key, defaultValue); }
public String get(String key, String defaultValue) { return context().get(key, defaultValue); }
/** * Convenience method for hello world :) * @param s - the content to render as plain text */ protected void renderText(String s) { LOG.debug("{}: {}", MimeType.TEXT, s); context().rendered = true; response().setContentType(MimeType.TEXT); writer().print(s); }
/** * Convenience method for hello world :) * @param s - the content to render as plain text */ protected void renderText(String s) { LOG.debug("{}: {}", MimeType.TEXT, s); context().rendered = true; response().setContentType(MimeType.TEXT); writer().print(s); }
/** * Convenience method for hello world :) * @param s - the content to render as plain text */ protected void renderText(String s) { LOG.debug("{}: {}", MimeType.TEXT, s); context().rendered = true; response().setContentType(MimeType.TEXT); writer().print(s); }
protected void render(Class<? extends View> cls) { context().rendered = true; getInstance(cls).render(); }
protected void render(Class<? extends View> cls) { context().rendered = true; getInstance(cls).render(); }
protected void render(Class<? extends View> cls) { context().rendered = true; getInstance(cls).render(); }
protected void renderJSON(Class<? extends ToJSON> cls) { context().rendered = true; response().setContentType(MimeType.JSON); getInstance(cls).toJSON(writer()); }
protected void renderJSON(Class<? extends ToJSON> cls) { context().rendered = true; response().setContentType(MimeType.JSON); getInstance(cls).toJSON(writer()); }
protected void renderJSON(Class<? extends ToJSON> cls) { context().rendered = true; response().setContentType(MimeType.JSON); getInstance(cls).toJSON(writer()); }