Why is @Validated required for validating Spring controller request parameters?

With the following validation setup in an annotated MVC controller: @RestController @RequestMapping(“/users”) @Validated // <-- without this, the @Size annotation in setPassword() has no ...

How can i get pdf files from FTP server as base64 encoding format on Java spring mvc project?

I’m trying getting files from FTP server on Java spring mvc project. I’m study on windows but my tomcat server is in linux machine. Following code returns base64 encoding files and created base64 url …

ServletContext not able to inject through by passing it as an parameter in Spring MVC

Hi all i am trying to get ServletContext in my following method but it is not getting injected while passing it as an parameter as it should be injected by the spring automatically but its not working …

Spring Security roles issue

I overrode the method in the SpringWebConfig and I want to give all pages of application only for admins. @Override protected void configure(HttpSecurity http) throws Exception { http….

How to create a single instance of object across entire Spring MVC web application?

I have a Spring MVC web application (XML based without annotations). I want to create only one instance of statsDClient object on start of my application and use it across my whole application. I am …

HTTP Status 404 – Not Found: for controller – no view resolvers found in Idea

I have the following Spring MVC code: config files: public class MainWebAppInitializer implements WebApplicationInitializer { @Override public void onStartup(final ServletContext sc) throws …

Cannot pass JWT refresh token as an argument

I’m trying to get a new access token using a refresh token in Spring Boot with OAuth2. It should be done as following: POST: url/oauth/token?grant_type=refresh_token&refresh_token=…. It works …

Connect Spring MVC with aws documentDB

I’m using mongoDB with aws ec2 instance it’s working fine and I’ve moved mongoDB to aws documentDB, So i’m not able to connect documentDB with same code, So any one can u please help me if you have …

Spring generate progressive unique int for entity

I am working on a REST api in Spring, and I’m required to save an entity Document with a protocol number which consists in: progressiveInt/currentyear Here is the model: @Entity public class …

Is it okay to declare Spring MVC response DTOs as static nested classes?

Sometimes it is very convenient to use Spring MVC automatic object-JSON conversion feature when you are designing RESTful API for your web application. For this feature to work, one needs to define a …