Java Spring Security – User.withDefaultPasswordEncoder() is deprecated?

EDIT: deleted old answer, misunderstood the question. Here’s the new one: User.withDefaultPasswordEncoder() can still be used for demos, you don’t have to worry if that’s what you’re doing – even if it’s deprecated – but in production, you shouldn’t have a plain text password in your source code. What you should be doing instead of … Read more

Initializing Log4J with Spring?

You could configure your Log4j listener in the web.xml instead of the spring-context.xml <context-param> <param-name>log4jConfigLocation</param-name> <param-value>/WEB-INF/classes/log4j.web.properties</param-value> </context-param> <listener> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> </listener> So it is up before Spring starts.

Can not find the tag library descriptor of springframework

I know it’s an old question, but the tag library http://www.springframework.org/tags is provided by spring-webmvc package. With Maven it can be added to the project with the following lines to be added in the pom.xml <properties> <spring.version>3.0.6.RELEASE</spring.version> </properties> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> Without Maven, just add that jar to your classpath. In any … Read more

Spring 3.1 JSON date format

In order to override the default date formatting strategy of Jakson following are the step to follow: Extend JsonSerializer to create a new class for handling date formatting Override serialize(Date date, JsonGenerator gen, SerializerProvider provider) function to format date in your desired format and write it back to generator instance (gen) Annotate your date getter … Read more

How to add new schedule job dynamically with Spring

If you want to dynamically schedule tasks you can do it without spring by using ExecutorService in particular ScheduledThreadPoolExecutor Runnable task = () -> doSomething(); ScheduledExecutorService executor = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors()); // Schedule a task that will be executed in 120 sec executor.schedule(task, 120, TimeUnit.SECONDS); // Schedule a task that will be first run in 120 sec … Read more

Multipart File upload using Springfox and Swagger-ui

I think you are missing the consumes attribute of the @RequestMapping in your second snippet. See the following example @RequestMapping( path = “/upload”, method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public ResponseEntity<String> handleUpload( @RequestPart(“file”) MultipartFile file, @RequestParam(“someId”) Long someId, @RequestParam(“someOtherId”) Long someOtherId) { return new ResponseEntity<>(); }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)