Category "spring"

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

Spring Webclient block() method executing forever not returning value

I am working on oauth implementation, by following the https://developer.okta.com/blog/2021/05/05/client-credentials-spring-security It's a test client, I am ge

Inject application properties without Spring

I would like a simple, preferably annotation-based way to inject external properties into a java program, without using the spring framework (org.springframewor

How to change the "Browse" button text

I need to change the "Browse" button text according to the locale in a JSP. (Ex. Russian , Portuguese) for a Spring based project. Following is the current imp

Creating Pagination in Spring Data JPA

I am trying to implement pagination feature in Spring Data JPA. I am referring this Blog My Controller contains following code : @RequestMapping(value="/orga

Intellij "cannot resolve symbol" after installing spring boot

I've recently installed the plugin "spring boot assistant" into my Intellij. When I was trying to run an old java file that I've completed before, a lot of the

com.netflix.client.ClientException: Load balancer does not have available server for client: account-service

I am getting the below error when http://localhost:6161/customer/1001 calling the URL. I've taken a reference from the link: https://github.com/PacktPublishing

Spring no mapping found for HTTP request with URI[require.js] in DispatcherServlet

Ok the full error is WARNING: No mapping found for HTTP request with URI [/sequenziatore/$%7BpageContext.request.contextPath%7D/resources/js/libs/require.js] in

Spring Boot 404 when trying to load a HTML file using Thymeleaf

Like the title says, I'm getting the Whitelabel 404 error page when trying to access localhost:8080. Main class: package com.michaelLong.studentaddressbook;

Spring Interceptor is not compatible with @RepositoryRestResource

@Component public class TestInterceptor implements HandlerInterceptor { @Override public void afterCompletion(HttpServletRequest arg0, HttpS

Alerts or popup message boxes in Spring MVC

I am having a user add form userAdd.jsp. When I enter data and submit, I want to check whether the username field entered is unique compared with the databse.