Spark (software)

Web application framework

For the mobile email application, see Spark (application). For the data processing framework, see Apache Spark.

The topic of this article may not meet Wikipedia's notability guidelines for products and services. Please help to demonstrate the notability of the topic by citing reliable secondary sources that are independent of the topic and provide significant coverage of it beyond a mere trivial mention. If notability cannot be shown, the article is likely to be merged, redirected, or deleted.
Find sources: "Spark" software – news · newspapers · books · scholar · JSTOR (May 2014) (Learn how and when to remove this template message)

|

Spark

Original author(s)| Per Wendel
Initial release| 2011; 12 years ago (2011)
Stable release|

2.9.3[1] / 8 October 2020; 3 years ago (8 October 2020)

Repository| Spark Repository
Written in| Java
Operating system| Cross-platform (Java Virtual Machine)
Type| Web application framework
License| Apache License 2.0
Website| 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,[citation needed] 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."[2]

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)[edit]

import static spark.Spark.*;

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

## Supported template engines[edit]

Spark supports these template engines:[3]

* Apache Velocity
* FreeMarker
* Mustache
* Handlebars
* Jade
* Thymeleaf
* Pebble
* Water
* jTwig
* Jinjava
* Jetbrick

## References[edit]

1. ^ "Release 2.9.3". 8 October 2020. Retrieved 18 October 2020.
2. ^ Spark Framework: An expressive web framework for Kotlin and Java
3. ^ Views and Templates - Documentation - Spark Framework: An expressive web framework for Kotlin and Java

## External links[edit]

* Official website
* Spark's GitHub repository