本文整理了Java中spark.Spark.externalStaticFileLocation()
方法的一些代码示例,展示了Spark.externalStaticFileLocation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Spark.externalStaticFileLocation()
方法的具体详情如下:
包路径:spark.Spark
类名称:Spark
方法名:externalStaticFileLocation
[英]Sets the external folder serving static files. Observe: this method must be called before all other methods.
[中]
代码示例来源:origin: neo4j-examples/neo4j-movies-java-bolt
public static void main(String[] args) {
setPort(Util.getWebPort());
externalStaticFileLocation("src/main/webapp");
final MovieService service = new MovieService(Util.getNeo4jUrl());
new MovieRoutes(service).init();
}
}
代码示例来源:origin: vqtran/EchoQuery
private static void runSparkServer() {
Spark.externalStaticFileLocation("public/");
Spark.get("/user/:id", (request, response) ->
new ModelAndView(new HashMap<>(), "index.jade"),
new JadeTemplateEngine());
Spark.get("/fetch/:id", (request, response) ->
VisualizationUtil.getUserData(request.params(":id")).toString());
Spark.get("/fetch/", (request, response) -> "Enter a valid User ID");
Spark.get("/login/:id", (request, response) ->
new LoginHandler(request, response).respond());
Spark.post("/submit/:id", (request, response) ->
new SubmitHandler(request, response).respond());
}
}
内容来源于网络,如有侵权,请联系作者删除!