MCPcopy Create free account
hub / github.com/annmuor/jnode / JsRoute

Class JsRoute

jnode-httpd-module/src/org/jnode/httpd/routes/JsRoute.java:27–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25import spark.Route;
26
27public abstract class JsRoute extends Route {
28
29 protected JsRoute(String path) {
30 super(path);
31 }
32
33 public JsRoute(String path, String acceptType) {
34 super(path, acceptType);
35 }
36
37 @Override
38 public final Object handle(Request req, Response resp) {
39 StringBuilder sb = new StringBuilder();
40 String cb = req.queryParams("cb");
41 if (cb != null) {
42 sb.append(cb + "(");
43 }
44 sb.append(_handle(req, resp));
45 if (cb != null) {
46 sb.append(")");
47 }
48 resp.type("text/javascript");
49 return sb.toString();
50 }
51
52 protected abstract Object _handle(Request req, Response resp);
53
54}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected