Dev

Spring MVC: how to build a thread-safe Controller

Controllers in Spring MVC are designed to be shared between requests. Each controller has a default singleton scope so if you are using controllers you need to be aware of that. The easiest way to make sure your controller is thread-safe is to avoid class variables. F.ex. this example from Spring MVC tutorial:

Hibernate: how to enable show sql

To see the SQL that your application sends to the database during the execution, insert the following property in your XML property file:

JSP tutorial : custom format

I’ve come around a problem when I needed to format DateMidnight date in JSP. Here I’ll explain 2 ways of doing this, where the other one applies only to joda.

How to specify shared object path in Linux

If you’re on a system as a user and with no means of installing custom libraries or updating libraries for your custom program, you can load your own libraries with this simple command.