Spark - A tiny Sinatra inspired framework for creating web applications in Java 8 with minimal effor

Spark - A tiny Sinatra inspired framework for creating web applications in Java 8 with minimal effort

Quick start

import static spark.Spark.*;

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

Run and view


Built for productivity

Spark is a simple and lightweight Java web framework built for rapid development. Spark‘s intention isn‘t to compete with Sinatra, or the dozen of similar web frameworks in different languages, but to provide a pure Java alternative for developers that want to, or are required to, develop in Java.

Spark focuses on being as simple and straight-forward as possible, without the need for cumbersome (XML) configuration, to enable very fast web application development in pure Java with minimal effort. It’s a totally different paradigm when compared to the overuse of annotations for accomplishing pretty trivial stuff seen in other web frameworks, for example, JAX-RS implementations.

Why use Spark?

If you‘re a Java developer with neither the urge nor time to learn a new programming language, and you‘re not planning to build a super large web application that scales in all directions, then Spark might be a great web framework for you. It will have you up and running in minutes, and you won‘t have to think too much about configuration and boilerplate code (like you often have to in other Java web frameworks, like Spring or Vaadin).

Why not use Sinatra?

If you‘re an experienced Ruby developer, or have experience with languages with similar syntax, you should definitely use Sinatra. However, if you‘re a Java developer and want to get the benefits you get from Sinatra without having to learn a new language, Spark is a really good alternative. Spark is a simple and lightweight Java web framework that doesn‘t get in your way!

Why not go with JAX-RS?

JAX-RS made life easier for Java web developers when it arrived. However, it‘s a bit messy due to the overuse of annotations for accomplishing pretty trivial things. The annotation magic also makes things more implicit, and it‘s not always easy to get a clear understanding of what‘s going on. For people who are new to web frameworks and REST, Spark will have you up and running much faster than using one of the JAX-RS implementations.

时间: 11-22

Spark - A tiny Sinatra inspired framework for creating web applications in Java 8 with minimal effor的相关文章

如何使用 Docker 部署一个基于 Play Framework 的 Scala Web 应用?

本文作者 Jacek Laskowski 拥有近20年的应用程序开发经验,现 CodiLime 的软件开发团队 Leader,曾从 IBM 取得多种资格认证.在这篇博文中,Jacek 分享了 Warsaw Scala Enthusiasts Meetup 上 Rafal Krzewski 介绍的一个 Docker sbt 插件.本文系 OneAPM 工程师编译整理: 虽然在 项目中,Docker 已得到了非常深入的应用,但是如果没有接触到 Rafal Krzewski

基于.Net Framework 4.0 Web API开发(4):ASP.NET Web APIs 基于令牌TOKEN验证的实现

概述:  ASP.NET Web API 的好用使用过的都知道,没有复杂的配置文件,一个简单的ApiController加上需要的Action就能工作.但是在使用API的时候总会遇到跨域请求的问题, 特别各种APP万花齐放的今天,对API使用者身份角色验证是不能避免的(完全开发的API不需要对使用者身份角色进行管控,可以绕过),这篇文章就来谈谈基于令牌TOKEN身份验证的实现. 问题: 对于Web API的选择性的开放,使用者无论使用AJAX,还是HttpClient对接,总要对使用者的身份角色


转内容目录Astronomy构建工具缓存云计算命令行选项解析器命令行工具压缩配置文件解析器控制台用户界面加密数据处理数据结构数据库和存储开发工具分布式/网格计算文档编辑器Encodings and Character SetsGamesGISGo ImplementationsGraphics and AudioGUIs and Widget ToolkitsHardwareLangu


Build Tool Tools which handle the buildcycle of an application. Apache Maven - Declarative build and dependency management which favors convention over configuration. It's preferable to Apache Ant which uses a rather procedural approach and can be di


Indexes and search engines These sites provide indexes and search engines for Go packages: gowalker gosearch Sourcegraph Contributing To edit this page you must be a contributor to the go-wiki project. To get contributor access, send mail t


Awesome Java A curated list of awesome Java frameworks, libraries and software. Awesome Java Ancients Bean Mapping Build Bytecode Manipulation Cluster Management Code Analysis Code Coverage Compiler-compiler Configuration Constraint Satisfaction Prob

完整的中间件列表 Contrib Middleware connect-debounce — Distributed debounced function execution ala underscore on per session basis as connect middleware. connect-acceptoverride — Override `Accept` header to `application/jso


无论你是新开发者还是经验丰富的老程序员,前端框架可以有效地在开发的早期阶段提升开发效率.在这篇文章中,我们选择了15个新框架分享给开发人员,你肯定会想尝试一下这些新鲜的框架. 您可能感兴趣的相关文章 网站开发中很有用的 jQuery 效果[附源码] 分享35个让人惊讶的 CSS3 动画效果演示 十分惊艳的8个 HTML5 & JavaScript 特效 Web 开发中很实用的10个效果[源码下载] 12款经典的白富美型 jQuery 图片轮播插件 1. RAD.js RAD.js is a fr

Professional C# 6 and .NET Core 1.0 - 40 ASP.NET Core

本文内容为转载,重新排版以供学习研究.如有侵权,请联系作者删除. 转载请注明本文出处:Professional C# 6 and .NET Core 1.0 - 40 ASP.NET Core ----------------------------------------------------------------------- What's In This Chapter? Understanding ASP.NET Core 1.0 and Web Technologies Using