请输入您要查询的百科知识:

 

词条 Spark (software)
释义

  1. Example (Hello World)

  2. Supported template engines

  3. References

  4. External links

{{about||the mobile email application|Spark (application)|the data processing framework|Apache Spark}}{{notability|Products|date=May 2014}}{{Infobox software
| name = Spark
| logo =
| screenshot =
| caption =
| author = Per Wendel
| developer =
| released =
| latest release version = 2.6.0
| latest release date = {{start date and age|2017|04|25|df=yes}}
| operating system = Cross-platform (Java Virtual Machine)
| programming language = Java
| genre = Web application framework
| license = Apache License 2.0
| website = {{URL|sparkjava.com}}
}}

Spark is a free and open-source software web application framework and domain-specific language written in Java. It is an alternative to other Java web application frameworks such as JAX-RS, Play framework and Spring MVC. It runs on an embedded Jetty web server by default, but can be configured to run on other webservers.

Inspired by Sinatra, it does not follow the model–view–controller pattern used in other frameworks, such as Spring MVC. Instead, Spark is intended for "quickly creating web-applications in Java with minimal effort."[1]

Spark was created and open-sourced in 2011 by Per Wendel, and was completely rewritten for version 2 in 2014. The rewrite was hugely centered on the Java 8 lambda philosophy, so Java 7 is officially not supported in version 2 and above.

Example (Hello World)

import static spark.Spark.*;

public class HelloWorld {

   public static void main(String[] args) {         get("/hello", (request, response) -> "Hello World!");      }

}

Supported template engines

Spark supports these template engines:[2]

  • FreeMarker
  • Mustache
  • Apache Velocity
  • Thymeleaf
  • [https://github.com/neuland/jade4j Jade]
  • [https://github.com/subchen/jetbrick-template-2x Jetbrick]
  • Handlebars
  • [https://github.com/tiagobento/watertemplate-engine Water]

References

1. ^Spark
2. ^Views and Templates

External links

  • {{Official website|http://sparkjava.com}}
  • [https://github.com/perwendel/spark Spark's GitHub repository]

3 : Free software|Java platform software|Web frameworks

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/25 14:32:00