Skip to content

Category Archives: Spring

Spring Security, Replacing Acegi

Astute readers of my last Acegi article will note that Acegi has been assimilated into the Spring project, and is now called Spring Security. This next example is how I was able to get Spring Security running on my webapp. I decided early on that I did not want to mess up the other developers [...]

Configuring Applications with Spring

Carbon Five Community has a really nice article on different ways of implementing/overriding properties files in Spring. In a real-world application, we not only need to collect settings, but also override them in different environments. Many of our applications are deployed in 4 or more environments (developer machine, build server, staging server, and production), each [...]

Acegi 1.0.8 Example (Life Without the SecurityEnforcementFilter)

Note; This was my first day of adding Acegi to an existing webapp. You can find a lot of Acegi security framework examples on the web these days. Unfortunately, nearly all of the examples use Acegi use the pre 1.0 version, which is before someone removed the SecurityEnforcementFilter.. The official description of this event follows: [...]

My Latest Issue with Groovy, Spring, and Hibernate

I started this post about a year ago; I will admit my use of groovy has been a little tumultuous, and that’s prevented me from writing much about it. I’ve started a little webapp project – just something simple at first, to get back into doing the type of work that I enjoy doing (as [...]

Step by Step Tutorials – DWR with Spring, Ajax – Dynamic drop down lists

Scenario: A simple jsp page with a standard drop down box. A Selection criteria (could be another drop down box and a couple of check boxes) to change the values in these drop down box dynamically, without submitting the page. What you will learn: Configure dwr.xml with spring beans Configure application contexts for dwr beans [...]

Example code, sending emails using Spring SimpleMailMessage, MimeMessagePreparator and Velocity Templates

When I first wrote my custom Email utlity 4 years back using JavaMail, it spread well over hundred lines of code. Looking at Spring’s out of the box functionality for sending Emails with attachements & velocity templates makes you wanna feel sorry for your old code. The reference doc by Spring for Email is quite [...]

Adding a default error page in your webapp using SimpleMappingExceptionResolver

The next time you thought of writing a detailed exception handling logic for your webapp but continued to show java.lang.NullPointerException to the end users on the webpage. The following simple snippet of code would save you some harassmment from your manager more often than you think. Add this in your xxx-servlet.xml (Spring’s default config xml [...]

Spring Hibernate Annotation Criteria Query Example

I’ve written the start of another data load updating framework. This time I’m using Spring, Hibernate, and Hibernate Annotations. It took a little tweaking to get this to work, and so I’ve decided to add my example in the hopes that this will help others get started quickly. This is a very basic example but [...]

Configuration Properties, LOVs, static data using Spring Config

If you have a small project, often you would have webpages which load a bunch of dropdown values or static data; like a List of Values (LOVs) which have a code and description. Most probably you would be configuring these in a database and access via dao or even sophisticated would be a web service [...]

Debugging Spring MVC Startup Errors In Tomcat

I’ve been getting startup errors trying to deploy this spring MVC application: SEVERE: Error listenerStart I can’t find the error in the logs since this is a container start up error. Here’s what I did: Prequisite: attach the spring src Put a breakpoint in the ContextLoaderListener: in the spring jar on the build path, find [...]