Search results for: Open API

This tutorial will teach you how to add Spring Security to your project and enable in-memory basic authentication. You will learn how to configure two different users with different Roles and Privileges. Both users’ roles and privileges will be stored in the memory of your Spring Boot application. If you use Spring Framework and OAuth,…

Read More Spring Security In-Memory Authentication

In this tutorial, I am going to share with you a few different techniques you can use to iterate over a collection in Java. Iterating ArrayList with Enhanced For-Loop List<String> names = new ArrayList<>(); names.add(“Sergey”); names.add(“Bill”); names.add(“John”); for(String name: names) { System.out.println(name); } Output: Sergey Bill John We declare a List of String objects named…

Read More Iterating over Collections in Java: Examples

Optional<T> findFirst() class Test { public static void main(String[] args) { List<Integer> numbers = new ArrayList<>(Arrays.asList(3, 7, 9, 12)); Optional<Integer> resultOptional = numbers.stream().findFirst(); if (resultOptional.isPresent()) { // checking if Optional contains any value System.out.println(“The first element in the stream is: ” + resultOptional.get()); // getting the value from Optional } else { System.out.println(“The stream is…

Read More Streams – findFirst() operation

Learning how to convert Java objects into JSON and vice versa can be very helpful for your work as a full-stack mobile app developer. In this blog post, I will share some code examples that will help you with the most common tasks you’ll encounter when working with JSON and Java. I will cover the…

Read More Convert Java into JSON and JSON into Java. All Possible Examples.

In this article, we will learn about Many-to-Many relationships in JPA and how to implement them in a Spring Boot application. Let’s get started! @ManytoMany annotation A many-to-many relationship occurs when multiple records in one table are associated with multiple records in another table. The @ManyToMany annotation is used to define a many-valued association with…

Read More Many-to-Many Relationship in Spring Boot Rest with JPA

In this tutorial, you will learn how to download and start up Keycloak as a standalone server. What is Keycloak? Keycloak is an open-source identity and access management tool focusing on modern applications and services such as mobile applications, REST APIs, and single-page applications. How to Download Keycloak? To download the Keycloak go to the…

Read More Keycloak: Starting a Standalone Server

RESTful web services use HTTP methods and representations to manage resources. In order to properly handle these resources, it’s important to understand how to define the expected behaviour of an endpoint in terms of the HTTP request and response, including specifying request methods, headers, and media types. By using Spring’s @RequestMapping annotation, we can map…

Read More The @RequestMapping Annotation: A Comprehensive Guide

In this tutorial, you will learn how to enable the Actuator’s httpTrace endpoint in Spring Boot 3. In fact, /httptrace has been renamed to /httpexchanges, so this tutorial will teach you how to enable the Actuator’s /httpexchanges API endpoint instead of /httptrace. The httpexchanges endpoint provides information about HTTP request-response exchanges. These HTTP exchanges are essentially…

Read More How to Enable Actuator’s HttpTrace in Spring Boot 3

Spring Framework is a popular Java-based framework that provides a comprehensive infrastructure for developing Java applications. The framework was initially released in 2002 by Rod Johnson, who was frustrated with the complexity of the existing Java EE (Enterprise Edition) platform. He wanted to create a simpler and more lightweight framework that would make it easier…

Read More Excel in Spring Framework: The Complete Guide

AngularJS was among the first JavaScript frameworks with tons of functionality. Google developed this framework and open-sourced it in 2012. Since then, a team of google developers and open-source contributors have worked together in maintaining and updating this framework. Whether you believe it or not, AngularJS is easy to learn, and by the end of…

Read More A Step-by-Step Tutorial for Developing Your First AngularJS App