All built-in JSR 303 constraint annotations are intended to verify particular fields of our data classes. Yet, it is not unusual that several fields are connected to each other and should be checked as a unity.
For instance, a field can be required only if another field is set. @NotNull won’t work in such case as there is no way to introduce the condition logic. In this post you will learn how to write a validator applicable to multiple class fields.
Continue reading “Related field validation”
Some validation constraint can be applied to several different types. For instance the @Size annotation works with collections, arrays, and strings. This post is a guide on how to create a validation constraint which can be applied to different data types just like the aforementioned @Size annotation.
Continue reading “Custom validation annotation for multiple types”
In the previous post you could learn how to create a basic custom constraint annotation compatible with the Bean Validation standard. This demo will extend the former post by explaining how to create constraints which are more flexible due to parameters defined for particular use cases. If you’re totally unfamiliar with the topic, I refer you to the aforementioned post to grasp the essentials. Otherwise, just keep reading.
Continue reading “Custom parametrized validation annotation”
The Spring framework is the most widely adopted open source project in enterprise class applications. As the framework consists of dozens of modules, every team is interested only in a subset of changes introduces in the latest release. This post covers the list of new features that shouldn’t be missed by any developer whose application’s API relies on Spring 4 and is preparing for the upgrade in the foreseeable future.
Continue reading “Spring 4.3 recap for API-centric apps”
In the previous post you could read about separate Spring Boot builds for a local development machine and public environments. It’s highly possible that in addition to such setup you would like to load different Spring properties files based on the active Maven profile. In this note you will learn how to accomplish the desired result in a few easy steps.
Continue reading “Spring Boot properties per Maven profile”
The great thing about Spring Boot is no need for an external servlet container. All that is needed reside inside a single runnable JAR file. In a very few steps, development of a new application can be started without installation or configuration of any additional software.
Yet, sometimes you might want to deploy your application to some server as a regular WAR file. For instance, you convert an existing application and want to keep your continuous delivery pipe untouched or a particular container is enforced by a company’s policy. The reason for building a WAR file may vary across teams, but for development purpose a simple executable JAR file with an embedded server might be preferable.
Continue reading “Dual jar/war build for Spring Boot”
SharePoint is widely known among .NET developers, but not so recognized in the group of JVM worshippers. Yet, sometimes integration between these two universes is required and one of possible choices to perform the connection is the set of SOAP web services exposed by the platform. It this article you’ll learn how to communicate your Spring application with a SharePoint instance.
Continue reading “SharePoint Web Services, Spring, and NTLM authentication”
Continue reading “ES2015 – Ready for development”
Have you ever been in that conversation in which you had to choose between two or more frameworks/libraries and one of them was so-called JEE standard? Usually a person who advocates for it explains that thanks to standardized API it’s possible to switch the implementation to any vendor whenever needed without a worry that something in our application breaks. In theory, it sounds tempting, but does practice prove it? I’m going to focus on simple case using JAX-RS to verify the assertion.
Continue reading “JEE and the myth of portability”