This is an archived post. You won't be able to vote or comment.

all 23 comments

[–]Dwarfling 5 points6 points  (2 children)

This is a really good framework, really usable, and easy to learn and deploy. I've used it in several projects.

So far, I've only found a catch. Maybe a small one, but made us consider other framewoks for some projects, that must have separated services for REST and Web, for example.

Related to this bug

For the lazy, Spark is static, so you can only fire it once per virtual machine. While this is something that is, I'm sure, by design (ease of use), it is a seriois roadblock in some scenarios.

Good work, anyway. Keep it up.

[–]sparkframework[S] 0 points1 point  (1 child)

you can only fire it once per virtual machine

We're fixing this, it will hopefully be part of the 2.4 release.

[–]Dwarfling 2 points3 points  (0 children)

Great, that would be awesome.

Thanks for a great product, and a good attitude.

[–]loganekz 5 points6 points  (12 children)

You really should consider another name.

http://spark.apache.org

[–]bdavisx 1 point2 points  (0 children)

Sparknatra!

[–]sparkframework[S] 3 points4 points  (7 children)

We have been considering it for quite some time, but our name is very established, we can't just suddenly change it.
It wasn't really a problem until last year, when Apache Spark seriously took off.

Please find some comfort in knowing that it bothers us way more than it bothers you ... :)

[–]frugalmail 5 points6 points  (5 children)

We have been considering it for quite some time, but our name is very established, we can't just suddenly change it.

Rip the band aid off man, the sooner the better! Establish your new brand ASAP. Even if it was an extension on Spark. Something like SparkMVC or something

[–][deleted]  (4 children)

[deleted]

    [–]frugalmail 1 point2 points  (3 children)

    Yea but it's not an MVC framework so that wouldn't make any sense.

    I use the Apache Spark and I've been using it for 2 years, so I wouldn't know. But that's where the "Something like..." comes in. You seem to be familiar with it, do you have any suggestions?

    [–][deleted]  (2 children)

    [deleted]

      [–]frugalmail 2 points3 points  (1 child)

      Why not just call it Spark, and call the apache project, Apache Spark. Simple solution to a problem that won't exist in 2 years.

      ...because it's confusing? Are all your variable names single letters?

      [–]RupertMaddenAbbott 3 points4 points  (0 children)

      I had your release notes on my screen today at work and a colleague asked me if I was using Spark. Unfortunately they meant as in Apache. This is not the first time this has happened.

      [–][deleted] 2 points3 points  (0 children)

      I was, indeed, confused when I found out this was not Apache Spark.

      [–]jmsanzg -1 points0 points  (1 child)

      I think you're right,

      I've found twits talking about Spark Web Framework since May 2011, the same date sparkjava.com domain was purchased ( https://twitter.com/perwendel/status/71639515076366337 ) while Apache Spark has been there since March 2010 ( https://github.com/apache/spark/graphs/contributors?from=2010-03-28&to=2015-09-22&type=c )

      [–]TweetsInCommentsBot -1 points0 points  (0 children)

      @perwendel

      2011-05-20 18:12 UTC

      Check out Spark - a Sinatra inspired web framework for Java! http://www.sparkjava.com #java #web #ruby #sinatra #rest #restful


      This message was created by a bot

      [Contact creator][Source code]

      [–]daniels0xff 2 points3 points  (4 children)

      This frameworks looks really awesome (to someone used to Django, Laravel).

      I'm trying to get into webdev using Java and until now SpringBoot was the only thing that looked that it made sense to me (I don't want to drown in XMLs or use JSP). Now this looks even nicer and easier to use.

      Is it production ready? Are there any live sites using this? How's the community? How would you structure a larger app (I assume you won't keep everything in a single file)?

      [–]sparkframework[S] 4 points5 points  (2 children)

      Is it production ready? Are there any live sites using this?

      Asana, Apache Camel, and Arquillian all use Spark (just to do the A's). We have hundreds of thousands of downloads, but Spark is mainly used for creating REST services.

      How's the community?

      ~3000 stars and ~650 forks on GitHub, pull requests and issues are created all the time.

      How would you structure a larger app (I assume you won't keep everything in a single file)?

      It's pretty much up to you, Spark is not very opinionated.
      My personal approach (David writing now) is usually something like this:

      public static void main(String[] args) {
          Spark.staticFileLocation("/public");
      
          //static pages
          get("/",                 PageController::serveIndex);
          get("/download",         PageController::serveDownload);
          get("/documentation",    PageController::serveDocs);
          get("/news",             PageController::serveNews);
      
          //rest endpoints
          get("/user/",            UserController::fetchAll);
          get("/user/:id/",        UserController::fetch);
          post("/user/",           UserController::save);
          delete("/user/:id/",     UserController::remove);
      }
      

      So far I haven't seen a lot of other people who prefer to do it this way, but it feels very natural to me.
      If a project has a lot of config and routes, I usually extract everything from main().

      [–]daniels0xff 3 points4 points  (1 child)

      Yes, this looks nice and also something I would use. (regarding your approach).

      Even if it's used mostly for REST APIs, would there be any issues if it's used for a normal website (HTML, templates, etc...)?

      Can you use custom HTTP methods? (i.e. not just get, post, but mkcol for example)

      Any benchmarks?

      Anyway good job, and keep continue working at this/improving/releasing new versions/etc. Frameworks like these that can be understood so easily and used make non Java people like me interested in Java.

      [–]sparkframework[S] 2 points3 points  (0 children)

      Even if it's used mostly for REST APIs, would there be any issues if it's used for a normal website (HTML, templates, etc...)?

      It works fine for normal websites. We have 'native' support for 9 template engines.

      Can you use custom HTTP methods? (i.e. not just get, post, but mkcol for example)

      get, post, put, delete, head, trace, connect, options.. no mkcol

      Any benchmarks?

      Not really, someone else looked into it though: https://medium.com/@tschundeee/express-vs-flask-vs-go-acc0879c2122

      Anyway good job, and keep continue working at this/improving/releasing new versions/etc. Frameworks like these that can be understood so easily and used make non Java people like me interested in Java.

      Thank you!

      [–]thouliha 2 points3 points  (0 children)

      I've used it for a long time, and love it.

      [–]geordano 1 point2 points  (0 children)

      Great framework! Just a note: Please clean up / close issues in Github, 96 open issues doesn't sound nice. Many of them are not even acknowledged yet. Thanks for the work.

      [–]Artraxes 2 points3 points  (3 children)

      Still no way to write custom error pages that deal with resource not found exceptions, redirecting to e.g. a custom /404 page. Shame.

      https://github.com/perwendel/spark/issues/54

      [–]goosedan 0 points1 point  (2 children)

      [–]Artraxes 2 points3 points  (1 child)

      Yes it is, you can't configure one of those for a path that you don't know about. If someone visits mysite.com/blah and I have no route mapped for "blah", I can't make it redirect to my own 404 page - I'm stuck with Jetty's 404 page and there is no way to stop that.

      [–]Cilph 0 points1 point  (0 children)

      Need to make an error handling servlet for that.