Category "spring"

Are there any big spring-boot open source projects?

I'm currently developing a spring boot application and would like to see some kind of real-world examples of how big spring boot projects can be architectured.

@PreAuthorize stops propagating exceptions thrown during evaluation of security checks

I have a controller with several endpoints. Every endpoint is mapped to a service which could return 200 or throw an exception, that is then handled and will re

How can I use mysql table as a unique key generator in Spring Boot JPA?

I want to generate unique keys at run time across regions and the key generation will be owned by master region. I will have one table with one column(key) with

Spring Controller @ResponseBody text/xml response UTF-8 encoding issue

I have annotation based Spring Rest Service running on jetty web server(also tomcat).The controller code is : @RequestMapping(method = RequestMethod.POST, val

Running code after Spring Boot starts

I want to run code after my spring-boot app starts to monitor a directory for changes. I have tried running a new thread but the @Autowired services have not

How to add new Datasource at runtime Spring Boot

I have this, but I don't find any possible solution. All the answers I found was about configuring two or more Datasource or Multitenant Dabatase, but It is not

Kotlin's Arrow Either<Exception, X> and transactions

I am trialing the use of Kotlin's Arrow library Either object to handle exceptions within a project. My experience with it thus far has been OK, but I'm struggl

Spring Interceptor has different traceId for afterCompletion method with Spring sleuth 3.x.x

I am currently working on a Spring boot project. Recently I upgraded the version of my Spring boot from 2.3.3 to 2.6.6. In Spring boot 2.3.3 I was using Spring

page size in spring boot to get total size

the default size of page is 20, I want to be able to get all elements from endpoint url. to get 30 elements I set size like below : http://localhost:8080/api/in

Dynamically Populate Drop down List In Spring MVC

I am new to Spring MVC. I have two Dropdown Lists in Jsp.One for country and Other for State. As soon as i select country from list State list should be populat

How to check which Quartz Scheduler job is not running

I have below code which i have used to check which quartz scheduler job is running. And it also send me an email the list of running scheduler job. But i dont k

Creating strict mock when using @MockBean of spring boot?

I use @MockBean of spring boot (with @RunWith(SpringRunner.class)) and everything was ok so far. However the mock provides default implementation for every meth

spring boot logback-spring.xml maxFileSize not working with SizeAndTimeBasedRollingPolicy

I want to configure logging in spring boot application. I have configure logback-spring.xml. The sample of logback-spring.xml is located on here and sample of a

Spring Boot: Use ThreadLocal-variable or pass parameters

I´m wondering what is best practice with spring-boot and the already provided helper-classes that use ThreadLocal for saving values suche as LocaleContext

Spring Batch how to process list of data before write in a Step

I am trying to read client data from database and write processed data to a flat file. But I need to process whole result of the ItemReader before write data.

Spring Boot - Test for controller fails with 404 code

I want to write a test for controller. Here is test snippet: @RunWith(SpringRunner.class) @WebMvcTest(WeatherStationController.class) @ContextConfiguration(cla

how to use spring4 @RestController to return a jsp page?

When I use spring3 @Controller like this: @RequestMapping("/userCenter") @Controller public class LoginCtrl { @RequestMapping("/loginPage") public Str

UnsatisfiedDependencyException: Error creating bean with name

For several days I'm trying to create Spring CRUD application. I'm confused. I can't solve this errors. org.springframework.beans.factory.UnsatisfiedDepende

Spring boot exception handling best practice

I have a simple question about exception handling. I currently have an application divided into multiple layers: controller, service, repository, and my questio

Support multiple pathmapping in Swagger UI/Spring boot

I am using swagger 2.0 in a Spring boot(version 1.5.9.RELEASE) project. Swagger works fine but now documentation have hundreds of api and I want to redirect doc