Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

I've made some modifications to the work that Marcelo contributed for the Spring Boot integration.  I still consider this in flux though and suggestions are welcome.

Here's the new updated project layout:

Image RemovedImage Added

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

Image RemovedImage Added

Another option to register a Juneau REST resource is to simply return that resource as a Spring bean like so:

Image Removed

is to add the @JuneauRest annotation on your configuration bean method:

Image Added

The root resource will be initialized with the SpringRestResourceResolver which allows for child resources to 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:

Image Removed

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?