Migrating a Spring Application from Tomcat 5 to GlassFish

I’ve got a Spring Web application that has been running happily on Tomcat for a while, but I wanted to migrate it to GlassFish. This proved a relatively simple process as only a couple of changes were needed to the application.

The application was originally built along the lines of the Spring MVC tutorial. When this app is deployed to GlassFish however, the Spring tag library (spring.tld) cannot be found (presumably due to different servlet versions).

To make the application deploy successfully, remove the entry from the web.xml file – its not needed in GlassFish. You then need to specify details of the Spring tag library in your JSP page with something like:

Thats all. A couple of simple changes and the web application deploys on GlassFish.