News

Video : Spincast Framework application from scratch in under 3 minutes

2017-01-08T12:00+0000

A tutorial video has been posted on Youtube : Spincast Framework application from scratch in under 3 minutes.

Please watch in 1080p to see the code clearly!

Bootstrapping++

2017-01-02T12:00+0000

This release is all about bootstrapping a Spincast application. This process has been greatly improved and the creation of the Guice context associated with an application is now easier. A new component, the Bootstrapper, is at the core of this process.

Here's a fully working "Hello World!" Spincast application :

public class App {

    public static void main(String[] args) {
        Spincast.init();
    }

    @Inject
    protected void init(DefaultRouter router, Server server) {
        router.GET("/").save(context -> context.response().sendHtml("<h1>Hello World!</h1>"));
        server.start();
    }
}

Speaking of "Hello world!" applications, you can now find three of them in the "Demos / Tutorials" section! :

Finally, we introduced a new section in the documentation dedicated to plugins : what they really are, how to install them, etc.

HTML Forms & Validation

2016-11-26T12:00+0000

This release is huge. We have been working on it for more than 3 months now. The last released version of Spincast contained approximately 800 tests, there are now over 1600!

The core of this release is about HTML Forms and Validation. There's a lot more than that, but those are the two big novelties.

Try the new demos

Spincast supports Json and XML out of the box since day one, so developing a Single Page Application or a set of REST services has always been easy. But, even if SPAs are very popular these days, any serious web framework must provide excellent support for traditional websites too, where the server generates the HTML to render.

As long as you integrate a good Templating Engine, providing HTML generation functionalities is not too hard. What's more challenging is to provide a good experience when it's time to deal with forms and their validation... And we think we hit the nail on the head! Spincast now provides an easy way to validate a submitted form and to redisplay it with Validation Messages resulting from the validation, when this is required.

Another big change in this release is about JsonObjects : they are now more powerful than ever and they are used pretty much everywhere in Spincast. We added to them a feature we call JsonPaths : this makes retrieving an element, inside an element, inside an array, inside an element, as simple as :

Date myDate = myJsonObject.getDate("user.books[3].publishingDate").

We also added a small Quick Tutorial section which is a high-level view of the main steps involved when building an application using Spincast. And, finally, we cleaned a lot of code, which now follows more closely Java's standards (no more "I" prefixed interfaces!).

Etags / Cache headers / No cache / Cache busting

2016-07-30T21:00+0000

You can guess it from the title : this new release is all about HTTP Caching! HTTP Caching is a fundamental part of any web framework and was obviously a required step before Spincast 1.0.0.

Many frameworks only manage a very little part of the HTTP specification regarding caching. In general, they limit their support to GET requests by returning a 304 - Not Modified response instead of the requested resource if this resource hasn't changed, and they validate this by hashing the generated resource and setting the result as an ETag header. This is useful in some cases, but is in fact very limited... HTTP caching is way more sophisticated than this!

At the core of HTTP Caching management using Spincast, there is a new request context add-on : "httpHeaders()". This add-on helps to create very compliant REST endpoints. Most of the "freshness" headers are managed : If-Match, If-None-Match, If-Modified-Since and If-Unmodified-Since. In the other direction, the add-on helps to send Cache-Control, ETag and Last-Modified headers. It is also possible to send "no cache" headers to tell a client that it should never cache the resource, at all. Some of those cache headers can also be specified on the routes, directly.

Finally, a Cache Busting mechanism has been added. By adding a special code to the URL of a resource, you can easily invalidate the cached versions clients may have of it. Read more about it here.

Spincast presentation + redirection rules

2016-07-10T19:00+0000

We gave the website a small makeover! A cool presentation of Spincast and its features has been added to the home page. We also added a new section: Demos / Tutorials.

Finally, we implemented redirection rules. You can now easily specify that a route must be redirected to another one. This is useful, for example, when you change the URL of a resource but don't want the existing links to break.

Change log

Have a look at the Github commits page.

Twitter

You can follow us on .