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}

This Week in Spring - May 13th, 2014

Engineering | Josh Long | May 13, 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!

Preview Spring Security Test: Method Security

Engineering | Rob Winch | May 07, 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]

On Monday I announced the release of Spring Security 4.0.0.M1. This is the first of a three part blog series introducing the Spring Security Testing support. The series outline can be seen below:

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