You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Hi all,

I've made some modifications to the work that Marcelo contributed for the Spring Boot integration.

Here's the new project layout:

Here's what it looks like to start up a Spring app with Juneau REST resources:

The JuneauContextInitializer will process the @JuneauIntegration annotation, construct and register the root servlet, and associate a SpringRestResourceResolver with the servlet so that child resources can be defined as injectable Spring beans.

The App class is defined in the juneau-examples-rest-springboot project:

One note is that the files folder and juneau.cfg file in this example are stored in the resources folder so that this can be deployed as a single standalone uber-jar.  These files can now be kept either in the home directory or as part of the jar depending on whether you want to easily modify them or not.

The app can be launched from Eclipse using the juneau-examples-rest-springboot.launch file.  It will bring up the REST examples on port 5000.

There's probably much more we can do with Spring Boot here.  For example, the @JuneauIntegration annotation can only be applied to the top level app class.  Maybe it can be applied to bean getters in @Configuration classes or elsewhere?



  • No labels