Spark (software)

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.

Spark
Original author(s)Per Wendel
Stable release
2.9.1 / 22 May 2019 (2019-05-22)
RepositorySpark Repository
Written inJava
Operating systemCross-platform (Java Virtual Machine)
TypeWeb application framework
LicenseApache License 2.0
Websitesparkjava.com

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]

gollark: That is currently my top idea. But it has annoying tradeoffs.
gollark: And phones or something similar will probably replace basically all other personal computing hardware soon™, so aaaaaa.
gollark: I'm picking a phone to replace my mysteriously failed one, but apparently in my absence the phone market became even more bad.
gollark: It's just a solid aluminium sphere with no visible interfaces.
gollark: Can't wait for the next fully wireless iPhone.

References

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.