Entries

HOW-TO: Quartz Scheduler with Clustering in JEE application with MySQL

Quartz Scheduler is one of the most popular scheduling library in Java world. I had worked with Quartz mostly in Spring applications in the past. Recently, I have been investigating scheduling in JEE 6 application running on JBoss 7.1.1 that is going to be deployed in the cloud. As one of the options I consider is Quartz Scheduler as it offers clustering with database. In this article I will show how easy is to configure Quartz in JEE application and run it either on JBoss 7.1.1 or WildFly 8.0.0, use MySQL as job store and utilize CDI to use dependency injection in jobs. All will be done in IntelliJ. Let's get started.

Spring MVC and Thymeleaf: how to acess data from templates

Spring MVC and Thymeleaf: how to acess data from templates I wrote this article for thymeleaf.org, with a great help of Daniel Fernández. You can find it here: http://www.thymeleaf.org/doc/articles/springmvcaccessdata.html ” 12/11/2016: Updated to Thymeleaf 3.0. Find the examples used in this article in this repository: https://github.com/kolorobot/spring-boot-thymeleaf ( http://blog.codeleak.pl/2014/04/how-to-spring-boot-and-thymeleaf-with-maven.html ) In a typical Spring MVC application, @Controller classes are responsible for preparing a model map with data and selecting a view to be rendered. This model map allows for the complete abstraction of the view technology and, in the case of Thymeleaf, it is transformed into a Thymeleaf context object (part of the Thymeleaf template execution context ) that makes all the defined variables available to expressions executed in templates. Spring model attributes Spring MVC calls the pieces of data that can be accessed during ...

HOW-TO: Spring Boot and Thymeleaf with Maven

Spring Boot is a great piece of software allowing you to bootstrap Spring application within a few seconds. And it really works. As little configuration as possible to get started. And still possible to change the defaults. Let's see how easily is to bootstrap Spring MVC with Thymeleaf and Maven and work with it in IntelliJ.

CSRF protection in Spring MVC, Thymeleaf, Spring Security application

Cross-Site Request Forgery (CSRF) is an attack which forces an end user to execute unwanted actions on a web application in which he/she is currently authenticated. Preventing CSRF attacks in Spring MVC / Thymeleaf application is fairly easy if you use Spring Security 3.2 and above.

Yet another way to handle exceptions in JUnit: catch-exception

There are many ways of handling exceptions in JUnit ( 3 ways of handling exceptions in JUnit. Which one to choose? , JUnit ExpectedException rule: beyond basics ). In this post I will introduce catch-exception library that I was recommended to give a try. In short, catch-exceptions is a library that catches exceptions in a single line of code and makes them available for further analysis.