Modular RAML Using Includes, Libraries, Overlays and Extensions REST RAML 1. Introduction In our first two articles on RAML – the RESTful API Modeling Language – we introduced some basic syntax, including the use of data types and JSON schema, and we showed how to simplify a RAML definition by… Continue Reading modular-raml-includes-overlays-libraries-extensions

Run a Java Application from the Command Line 1. Overview Typically, every meaningful application includes one or more JAR files as dependencies. However, there are times a JAR file itself represents a standalone application or a web application. We’ll focus on the standalone application scenario in this article. Hereafter, we’ll… Continue Reading java-run-jar-with-arguments

HttpSessionListener Example – Monitoring 1. Overview This tutorial will show how to register a javax.servlet.http.HttpSessionListener and track the number of active sessions in the web application using metrics. 2. Defining the Listener We can register the HTTP Session listener in the web.xml: <web-app …> <listener> <listener-class>org.baeldung.web.SessionListenerWithMetrics</listener-class> </listener> </web-app> Alternatively, in a… Continue Reading httpsessionlistener_with_metrics

Notify User of Login From New Device or Location 1. Introduction In this tutorial, we’re going to demonstrate how we can verify if our users are logging in from a new device/location. We’re going to send them a login notification to let them know we’ve detected unfamiliar activity on their… Continue Reading spring-security-login-new-device-location

A Guide to SqlResultSetMapping 1. Introduction In this guide, we’ll take a look at SqlResultSetMapping, out of the Java Persistence API (JPA). The core functionality here involves mapping result sets from database SQL statements into Java objects. 2. Setup Before we look at its usage, let’s do some setup. 2.1. Maven Dependency… Continue Reading jpa-sql-resultset-mapping

Formatting JSON Dates in Spring Boot 1. Overview In this tutorial, we’ll show how to format JSON date fields in a Spring Boot application. We’ll explore various ways of formatting dates using Jackson, which is used by Spring Boot as its default JSON processor. 2.Using @JsonFormat on a Date Field… Continue Reading spring-boot-formatting-json-dates