@Override public String contextPath() { return req.contextPath(); }
public static String getFullRequestURL(WebContext ctx, Request req, String path) { StringBuilder url = new StringBuilder(); url.append(ctx.getScheme()).append("://").append(ctx.getServerName()).append(":") .append(ctx.getServerPort()); url.append(req.contextPath()).append(path); req.queryString().ifPresent(query -> url.append("?").append(query)); return url.toString(); }
private String template(Request req) { String contextPath = req.contextPath(); return "<script>" + "window.LiveReloadOptions = {" + "host: '" + req.hostname() + "'," + "port: '" + req.port() + contextPath + "'" + "};" + "</script>\n" + "<script src=\"" + contextPath + "/livereload.js\"></script>"; }
@Override public String getFullRequestURL() { String query = req.queryString().map(it -> "?" + it).orElse(""); return getScheme() + "://" + getServerName() + ":" + getServerPort() + req.contextPath() + req .path() + query; }
@Override public String contextPath() { return req.contextPath(); }
@Override public String getFullRequestURL() { String query = req.queryString().map(it -> "?" + it).orElse(""); return getScheme() + "://" + getServerName() + ":" + getServerPort() + req.contextPath() + req .path() + query; }