Spring schemaLocation fails when there is no internet connection

A Spring application, built with Maven Shade plugin, was working normally, except when the internet connection was missing. . . . → Read More: Spring schemaLocation fails when there is no internet connection

Spring JDBC Template

Spring JDBC template is helpful to reduce boilerplate code, to use it, I first define a bean that use a data source, called dataSource, defined as in the previous post. . . . → Read More: Spring JDBC Template

Defining a JNDI DB connection with Tomcat

1. Install Your JDBC Driver

Copy the driver’s JAR file(s) into the $CATALINA_HOME/lib directory, which makes the driver available both to the resource factory and to your application.

2. Bootstrap the project

If you don’t have a project to play with already, you can bootstrap a project with Spring Roo. I’ve used version 1.2.1. I . . . → Read More: Defining a JNDI DB connection with Tomcat

Mavenizing Spring Security Tutorial

I couldn’t compile Spring Security Sample Tutorial Application, so I decided to change the build system from Gradle to Maven to see it in action.

Spring Roo 1.2.0 has just been released, so I used it to create the project structure fastly. Here are the commands typed in the shell:

mkdir security-tutorial cd security-tutorial roo . . . → Read More: Mavenizing Spring Security Tutorial

Adding Spring Security with Roo 1.1.5

Continuing with the previous example, let’s add security to the application. In the Roo Shell, I type:

security setup

Files created or updated:

Created META-INF/spring/applicationContext-security.xml Created views/login.jspx Updated WEB-INF/views/views.xml Updated pom.xml Updated WEB-INF/web.xml Updated WEB-INF/spring/webmvc-config.xml

New dependencies added:

spring-security-core 3.0.5.RELEASE spring-security-config 3.0.5.RELEASE spring-security-web 3.0.5.RELEASE spring-security-taglibs 3.0.5.RELEASE

In pom.xml I change the property spring-security.version to 3.1.0.RELEASE.

. . . → Read More: Adding Spring Security with Roo 1.1.5

Examining what Spring Roo 1.1.5 creates

Roo is Heaven and Hell.

Heaven is in the demos. It looks great, you can do a basic web application with Java in minutes!

Hell, when confronted with real world problems, and with bugs, but hey, I’ve not given up on it yet, it’s great to set up the basic project structure, and . . . → Read More: Examining what Spring Roo 1.1.5 creates

Eclipse: open implementation

I’m using the Spring Framework, I understood on my skin the importance of testing everything and to allow that dependency injection is important because allows to test every class independently from others. Further Spring favors programming to interfaces rather than concrete implementations.

To that respect I find a good idea to name the implementation with . . . → Read More: Eclipse: open implementation