H.Format fmt = actionContext.accept(); String s = v instanceof String ? (String) v : $$.toString(v, shouldUseToString); if (fmt.isText()) { return RenderText.of(status, fmt, s);
H.Format fmt = actionContext.accept(); String s = v instanceof String ? (String) v : $$.toString(v, shouldUseToString); if (fmt.isText()) { return RenderText.of(status, fmt, s);
public static H.Format contentTypeForErrorResult(H.Request<?> req) { H.Format fmt = req.accept(); if (req.isAjax()) { if (H.Format.UNKNOWN == fmt) { fmt = req.contentType(); } if (H.Format.JSON == fmt || H.Format.XML == fmt) { return fmt; } } return fmt.isText() ? fmt : H.Format.HTML; }
public boolean appliedTo(ActContext context) { H.Format format = context.accept(); return format.isText(); }
public boolean appliedTo(ActContext context) { H.Format format = context.accept(); return format.isText(); }
public static H.Format contentTypeForErrorResult(H.Request<?> req) { H.Format fmt = req.accept(); if (req.isAjax()) { if (H.Format.UNKNOWN == fmt) { fmt = req.contentType(); } if (H.Format.JSON == fmt || H.Format.XML == fmt) { return fmt; } } return fmt.isText() ? fmt : H.Format.HTML; }