Using new when.js 3.2.2 to build a front end for Spring Data REST

Engineering | Greg L. Turnquist | June 02, 2014 | ...

Greetings Spring community!

Roy Clarkson and I are presenting a talk at this year's SpringOne 2014 conference called Spring Data REST - Data Meets Hypermedia. We will explore how to quickly bridge the gap between a powerful Spring Data backend and a hypermedia enabled, RESTful front end.

In one part of the talk, we will delve into a javascript front end that lets the user takes pictures and upload them to a website. The website turns around and fetches images from the back end. By itself, this isn't that difficult thanks to the fully loaded RESTful API provided by Spring Data REST.

But fetching multiple images straight up isn't very efficient and is prone to freeze the web browser. Thanks to the CujoJS guys on our team (Brian Cavalier and John Hann), I was able to use the recently released when.js module

This Week in Spring - May 27th, 2014

Engineering | Josh Long | May 28, 2014 | ...

Welcome to another installment of This Week in Spring! Here in the States we had a 3-day weekend, which was nice. Good chance to watch some of those amazing tech talks! If you're like me, you've run out of tech talks, and will be glad to see that we have a lot more going up today!

  1. Grails project lead Graeme Rocher just announced Grails 2.4! The new release is amazing for a slew of reasons, not the least of which is that some of its many amazing features are easy to use with Spring Boot, too. Double win! Congratulations, Graeme and team. (And also thank you, for another amazing release!)
  2. Spring Boot 1.1.0.M2 is now available! The new release features improved support for Spring Data Solr, Spring Data Gemfire, and the entire Spring Data Dijkstra release train. The new release also offers GSP (Groovy Server Pages) and Velocity as templating options, along with upgrades to various libraries like Spring Security 3.2.4, and Spring Batch 3.0. This release train is moving quickly, so jump onboard while you can! There's a lot more great stuff, so check out the release notes.
  3. June webinars are here! Ramnivas Laddad on launches Spring Cloud on June 3rd in Abstracting PaaS services to be portable with Spring Cloud, Michael Minella in Spring Batch 3.0.0 on June 10th, and Glenn Renfro in Spring Integration Done Boot-ifully on June 17th.
  4. This blog introduces some of the limitations of Hibernate's inbuilt JDBC logging and then introduces log4jdbc as used in a simple Spring / Hibernate application.
  5. Our pal Eugen Paraschiv has put together a very nice introduction to Spring Data JPA.
  6. Matti Tahvonen over on the Vaadin team put together this fantastic introduction to using Spring Data Neo4j, Spring Boot, and of course the Vaadin4Spring library that Petter Holmström and I started. To be fair, it's only usable because of Petter :) So usable, in fact, that Matti was able to put together something beautiful - Bootiful - very quickly. Check it out! The application models (and visualizes!) data stored in Neo4j, so it's not just any old CRUD application, this is very cool!
  7. CloudFoundry ninja James Bayer announced the new Pivotal CF 1.2, which now supports VMWare's Hybrid Cloud Service, initial auditing and autoscaling, new data services (Redis, MongoDB, Neo4j, RiakCS, and ElasticSearch are all available!), and a lot more!
  8. Curiousity piqued? Want to learn more about CloudFoundry, the open-source Paas from Pivotal? Check out this epic video on how to setup your own Paas using BOSH from SpringOne2GX 2013. And hear about how other teams acutally did it in the SprignOne2GX replay - Free Yourself with CloudFoundry: A Private Cloud Experience.
  9. Data ninja Thomas Risberg just announced the new Spring for Apache Hadoop RC4 release, which is awesome! The new release improves upon the Spring YARN integration. YARN, of course, is the distributed, generic runtime on top of which Hadoop 2.0's very specific map/reduce support now sits. You can use YARN for job distribution of your own, however. You might, for example, use YARN to split up Spring Batch workloads. In the new example, Janne Valkealahti demonstrates a simple Spring Boot-powered Spring YARN component. It's amazing how concise this stuff is now!
  10. Want to learn more about Janne Valkealahti, the mad (data) scientist behind our Spring YARN support? Check out this Pivotal People profile!
  11. Spring Data lead Oliver Gierke does a nice job introducing the new hotness in Spring Data Dijkstra, the new Spring Data umbrella release. This release includes Java 8 Optional support, asynchronous repository method invocations, and more.
  12. Spring Security lead Rob Winch has just two small, bugfixe releases: Spring LDAP 2.0.2, and Spring Security 3.2.4
  13. Spring Web Services lead Arjen Poutsma has just announced Spring Web Services 2.2.0, which now features a Java configuration API and much more.
  14. Let me take a moment to remind everyone: Java configuration is everywhere! Spring framework, Boot, Data, Security, MVC, Integration, Batch, Social, and much more, all offer as-rich-as-the-XML Java configuration integrations. In the case of Boot, Java configuration is the only out-of-the-box option, though of course you can use XML if you'd like. It's just.. not expected.
  15. Spring Security lead also blogged about using Spring Security Test to handle web security
  16. Want to write your own Spring Boot starter? Check out this example from Spring ninja Stephane Nicoll on how to provide a HornetQ starter for Spring Boot
  17. At long last, Spring Social Google 1.0.0.GA has been released! Congratulations, Gabriel, on all the work required to arrive here. I like the easy-to-use example, too.
  18. Arnaud Giuliani has put together a very cool look at using GWT with Spring Boot. Nicely done, Arnaud!
  19. Netflix engineer Tomas Lin tweeted a link to a convenient Spring MVC exception handler for REST APIs. This is one (fine) way to approach the problem. As an alternative, I'd suggest you take a look at [using Spring HATEOAS' VndError(s) support]a).

Using the innovative Groovy template engine in Spring Boot

Engineering | Cédric Champeau | May 28, 2014 | ...

With the release of Spring Boot 1.1.0.M2 came the support for the new template engine that Groovy 2.3 provides. In this post, we will describe the benefits of using such an engine and of course how you can use it in Boot.

All the source code in this post is available on GitHub, so feel free to clone the repository and give it a try:

git clone https://github.com/melix/springboot-groovytemplates.git
cd springboot-groovytemplates
./gradlew run

Then open your browser on http://localhost:8080

This application is fully written in Groovy and also makes use of GORM for Boot, but it is of course…

Spring Boot 1.1.0.M2 Available Now

Engineering | Dave Syer | May 27, 2014 | ...

Spring Boot 1.1.0.M2 is available now in the Spring repositories. There are quite a few new features and plenty of new documentation:

  • Groovy Template and Velocity support for MVC and offline rendering.

  • Big changes to the HealthIndicator interface and the existing implementations, e.g. all database backends (like Mongo etc.) have a default HealthIndicator and the Actuator aggregates them all up into a single readout.

  • Support for Spring Data Solr and Spring Data Gemfire, and upgrade to the Spring Data Dijkstra release train

  • Support for multiple DataSources through a convenient

DataSourceBuilder abstraction, plus a similar feature for JPA

Preview Spring Security Test: Web Security

Engineering | Rob Winch | May 23, 2014 | ...

[callout title=Updated March 31 2015]This blog is outdated and no longer maintained. Please refer to the Test Section of the reference documentation for updated documentation. [/callout]

In my previous blog we demonstrated how the new Spring Security testing support can ease testing method based security. In this blog we will explore how we can use the testing support with Spring MVC Test.

Setting Up MockMvc and Spring Security

In order to use Spring Security with Spring MVC Test it is necessary to add the Spring Security FilterChainProxy as a Filter. For example:

@RunWith(SpringJUnit…

Preview Spring Security Test: HtmlUnit

Engineering | Rob Winch | May 23, 2014 | ...

[callout title=Updated March 31 2015]This blog is outdated and no longer maintained. Please refer to the Test Section of the reference documentation for updated documentation. [/callout]

In my previous blog we explored how we can use the testing support with Spring MVC Test. We will now see how the same support works with Spring Test MVC HtmlUnit.

[callout title=Minimum Versions]The Spring Security testing support does not work with spring-test-mvc-htmlunit-1.0.0.M1.jar. Instead, you just use the latest snapshot. This is due to some slight modifications to allow Spring Security and the…

What's New In Spring Data Dijkstra?

Engineering | Oliver Drotbohm | May 21, 2014 | ...

We've just announced the availability of the GA release of the Spring Data release train named Dijkstra. I'd like to use this chance to walk you through some of the features we added in this release.

5 new modules joining the train

The first big feature the release includes is the addition of 5 modules to the release train. Most of them have been around for quite a while but going forward we'll release them in sync with the other modules. The newly added modules are Spring Data Elasticsearch, Cassandra, Couchbase, Gemfire and Redis.

Spring Data Commons

A lot of the improvements of a release…

This Week in Spring - May 20th, 2014

Engineering | Josh Long | May 21, 2014 | ...

Welcome back to another installment of This Week in Spring! This week I'm in Krakow, Poland for Geecon, the Polish developer conference where, of course, I'll be speaking to developers about Spring. (and, maybe, Spring). If you're around, find me, I'll be wearing the giant Spring leaf t-shirt! :)

Other than that, there's a lot to get through so let's get to it!

  • In preparation for the upcoming Spring IO Platform, Spring Data release train Dijkstra has been released! This is a tremendous release train that includes: JPA, MongoDB, Neo4J, Apache Solr, Couchbase, Cassandra, Elasticsearch, Gemfire, Redis and Data REST! Congrats to the Spring Data Team!
  • Spring Boot 1.1.0 M1 is now available and introduces MongoDB and Gemfire support, as well as improved actuator metrics and health endpoints.
  • Final maintenance releases for the Spring Framework 3.2.x and 4.0.x versions are now available!
  • Spring Integration ninja (rockstar!) Artem Bilan put together a nice post introducing all the amazing Java configuration support in the nascent Spring Integration Java configuration DSL, which builds upon the basic @EnableIntegration support available in the just-released Spring Integration 4.0. You should read that post. Seriously. I want to steal some of Artem's thunder by excerpting this one amazing code-snippet:

    java @Bean IntegrationFlow helloWorldFlow() { return IntegrationFlows.from("helloWorldInput") .filter("World"::equals) .transform("Hello "::concat) .handle(System.out::println) .get(); } Yep! That's a Spring Integration flow that handles input messages, filters them, transforms them, and then gives them to the escape-hatch method, handle, which lets the developer insert any behavior into the mix. Remember, you can change anything about this - including where it gets the messages from and where it writes the messages to. Indeed, the output of one flow could be the input to another. Congratulations, Spring Integration team! Also, make sure to check out the launch webinar replay!

  • I know I mentioned this last week, but it's so worth a re-read! Groovy 2.3.0 is here! (Hah! Gotcha! This week's link was to a different post by the same author on the subject of the Groovy 2.3.0 release! But aren't you glad you read it, anyway?) Go, Groovy, go!
  • My pal Pieter Humphrey has done a nice introductory screencast on Spring XD - showing how to get up and running doing stream processing, and wiring it to an analytics dashboard in less than 7 minutes. XD uses a deceptively simple DSL (domain specific language) and no Java code - it's never been easier to work with Hadoop.
  • Spring Security lead Rob Winch has been moving heaven and earth to make unit-testing secure applications easier than ever. In this first installment of a new series, Rob looks at new annotations designed to stand in place of a live-fire Spring Security apparatus to mock a Principal, a UserDetailsService, and more. Check it out and stay tuned for more!
  • Speaking of Rob Winch, he gave an epic introduction to Spring Security at SpringOne2GX 2013 last year. This is a perfect place to jump onboard if you're new to Spring Security.
  • New Relic's Ashley Puls was kind enough to do a webinar with your humble author on Web Application Diagnostics using New Relic. Thanks, Ashley! I'll be very honest, this webinar was super informative for me. I knew just a little about New Relic, and in working through the development of the webinar I learned about a zillion and five use cases that are well served by New Relic. Really cool stuff!
  • Also published this week - a SpringOne2GX 2013 Replay by Emad Benjamin and Guillermo Tantucho: Virtualizing and Tuning Large Scale Java Platforms. This goes over JVM memory tuning and all the tricks and tips for getting Java to run well on a virtualized environment.
  • SpringOne2GX 2013 replay - a great talk from SAS Software: Migrating from WebLogic, WebSphere, JBoss to Pivotal tcServer. This might go well with a recent post on why App Servers are dead by Eberhard Wolff.
  • Do you love Spring's new home on the web, spring.io, as much as I do? Want to learn more? Check out this talk by project lead and Spring ninja Chris Beams on the makeup of the site, its development, and deployment.
  • Last week, Spring Data Neo4j lead and graph-ninja Michael Hunger and I gave a talk on Spring Boot and Neo4j. This talk was fun for me because it gave me a lot of excuses to play with Neo4j. In point of fact, Michael and I are doing a webinar on about the same subject on the 20th of May (that's 7 days away!), so come see what we've come up with. In the meantime, you may want to check out this recent post on creating a time-tree with Cypher, the language that Michael works on that's used to drive interactions with Neo4j. That post was, of course, a response to another post that Michael put together on importing forests into Neo4j, also worth a read!
  • I quite liked this post introducing how to setup a Spring Batch job using Spring Boot. The author found a comfortable configuration-middle ground in the Groovy BeanBuilder support, and describes it nicely in this post
  • Moritz Schulze has put together a very nice post, following others in the series, on how to integration test REST services
  • Are you using Spring Boot and want to use Spock? Netflix engineer Tomas Lin has put together an example on his GitHug page. Check it out!
  • Jakub Kubrynski has put together a nice post on how to use Spring Boot's org.springframework.boot.actuate.system.ApplicationPidListener (which Jakub contributed - thanks Jakub!) - to work with the application's process identifier (PID). Nice!
  • Meltdown 1.0.0 has been released! Meltdown is a Clojure interface to the Reactor project. So... functional programming and stream processing inside a lisp-like language? A dream! Check it out!

Demo: Zero to Stream processing in 7 minutes with Spring XD

Engineering | Pieter Humphrey | May 19, 2014 | ...

Speaker: Pieter Humphrey

Creating a stream of live twitter data for an analytics dashboard using Spring XD, a JavaScript D3 component / Spring XD's REST API.

Source code:https://github.com/spring-projects/spring-xd-samples/tree/master/analytics-dashboard

Learn more about Spring XD: http://projects.spring.io/spring-xd

Learn more about Spring for Apache Hadoop: http://projects.spring.io/spring-hadoop

!{iframe width="420" height="315" src="//www.youtube.com/embed/nOfzrQ6CdKI" frameborder="0" allowfullscreen}{/iframe}

Get the Spring newsletter

Stay connected with the Spring newsletter

Subscribe

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all