Category Archives: Spring

Reloading Tiles2 Config in Spring 3.x

When you are using Tiles for layout composition with Spring you configure it as a view resolver by adding something like this to the applicationContext.xml     <!– Configure the Tiles templates –>     <bean id=”tilesConfigurer”         class=”org.springframework.web.servlet.view.tiles2.TilesConfigurer”>        … Continue reading

Posted in Spring | 1 Comment

Spring MVC Validation BindingResult

A quick note about using the BindingResult to detect and report errors in a form. One gotcha that got me was the need to set a name on the @ModelAttribute in order to properly relate the form:form commandName and the … Continue reading

Posted in java, Spring | 2 Comments

Spring @Autowired – Use interfaces!

Here’s a little lesson that I had to relearn today: When using Spring use interfaces. The premise was I had a DAO bean that was configured with Spring, and it was @Autowired into my controller (or test case in this … Continue reading

Posted in Spring | 1 Comment

Preauth in Spring Security 3.x

Sometimes in a webapp you will be in a situation where a filter/app/container other than Spring will be responsible for authenticating a user and setting the user principal, leaving the authz to the Spring webapp. A portlet container is a … Continue reading

Posted in java, Spring | Leave a comment

I want the last 2 hours back!

I just spent a few hours writing an Acegi filter to get a certificate from a form post, and put it into a modified User Detail principle. All well and good, except after a redirect back to / I got … Continue reading

Posted in java, Spring | Leave a comment

Spring and JNDI (Tomcat or Jetty)

Recently I had need to deploy some Spring webapps which required predeploy configuration. Being the first time I had to find a serious answer I looked to the mythical JNDI for an answer. This document is meant to complement other … Continue reading

Posted in java, Maven, Spring | 9 Comments

Hibernate, spring, and different jars

The situation is this. I had a working application which used Hibernate annotated classes, and JTA for data bindings, within a spring framework. Then I moved the annotated classes into a Jar file, and the application stopped working. Hibernate knew … Continue reading

Posted in java, programming, Spring | Leave a comment