Use value of a local variable as global in thymeleaf

I have a variable that is obtain inside each block in thymeleaf. I want to send that variable to a certain method in my controller. The limitation is that the variable is obtain inside a block which …

How adap Sleuth headers to make them compatible with OpenTracing

I’m working on a big stack of micro services written in Spring Boot, those services are using spring-cloud-starter-sleuth in order to trace the calls between several services. My concern is that I …

Can I choose to include/exclude what controller is deployed per environment in Spring Boot?

I would like to expose an endpoint only to certain TEST environment and leave it out altogether in PROD. I will have a separate @RestController for this endpoint. My question is how to ensure this …

Spring Jackson deserialize object with reference to existing object by Id

I have three entity classes of the following: Shipments Entity: @Entity @Table(name = “SHIPMENT”) public class Shipment implements Serializable { @Id @GeneratedValue(strategy = …

How do I load environment variables to load application context before integration test runs

I’m working on multi-module maven project using Spring Boot 2.4.0. I have written integration tests for a module. The test class looks similar to this. @RunWith(SpringRunner.class) @SpringBootTest(…

Error com.fasterxml.jackson Deploy .WAR Spring Boot in JBoss/Wildfly

ERROR [org.springframework.boot.web.servlet.support.ErrorPageFilter] (default task-22) Forwarding to error page from request [/api/method] due to exception [com.fasterxml.jackson.annotation.JsonFormat$…

Spring Security: redirect to single page app in case of 401

When I type into browser any route of my React app, for example: http://localhost/login, the request hits my server, and my server responds with 401 Unauthorized. When request is not an authorized …

How to prevent Spring from performing variable replacement

I have a configuration property that needs to be sent to another system as part of a post body. lets say for example if have an application.properties file with my.property.raw=${parameter:some-…

How to avoid using milliseconds when using OffsetDateTime.now()

I am using OffsetDateTime.now() to get the current date in UTC format and result includes milliseconds too. I don’t want milliseconds to be sent . Is there a way i can remove Milliseconds from …

how to resolve error executing ddl commands in spring boot

Hi I am new to spring Boot and i created new project(Demo) using spring initilizr Project structure is Project : Maven Project Language : Java Spring Boot : 2.4.2 application.propertites file is like …