All posts (10)
Spring Boot comes with very neat configuration mechanism. Default default application configuration is defined in one configuration file and environment specific setting in separate files. But still this mechanism is often not used properly resulting in verbose and unmaintainable configurations.
Defining error format is important part of REST API design.
Spring-Boot and Spring Security provide pretty nice error handling for RESTful APIs out of the box. Although it has to be documented, especially when contract-first approach to API design is used.
It is good idea to follow some common format for error responses. But OAuth2 specification and Spring Boot format may not satisfy those requirements.
Spring Boot is an excellent tool to bootstrap java application. Most of the references mention how to create a standalone java application, optionally with embedded web server (tomcat or jetty). But Spring Boot supports also creating web applications intended to run within servlet container.
Spring Framework offers very flexible means for binding application components. Externalizable properties, composite configuration, nested application contexts and profiles.
Sometimes, it is necessary to control whether particular beans or
@Configuration will be loaded or not. Spring Framework v.4.1.x does not provide that feature out of the box. But, hopefully, Spring allows conditional bean initialization (see
@Profile implementation and
So, I created the annotation
@Enabled which allows me to control bean instantiation via properties.
@Enabled indicates that a component is eligible for registration when evaluated expression is true. This annotation should be used in conjunction with Configuration and Bean annotations.