Upgrade from Spring 2.0 to Spring 2.5

15/06/2010 § 2 Comments


I’ve been upgrading recently the webapp I’m working on the moment from Spring 2.0 to Spring 2.5 (in the process to upgrade to 3.0) to enjoy Spring Annotations power.

This task is pretty straightforward and requires to substitute jars from 2.0 version with 2.5 version. It’s enough to download Spring Framework from here.
Big gotcha : spring-webmvc.jar is not part of spring.jar any more so you need to include both the jars to use SpringMVC

Now you can start enjoying annotation!
Start changing your Spring configuration file (dispatcher-servlet.xml or whatever you configure in web.xml) with something like:

<?xml version="1.0" encoding="UTF-8"?;>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:oxm="http://www.springframework.org/schema/oxm"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

// Declare all Beans here

</beans>

Ok, now you’re ready to use @Autowired, @Controller, @RequestMapping and so forth!

About these ads

Tagged: , , ,

§ 2 Responses to Upgrade from Spring 2.0 to Spring 2.5

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading Upgrade from Spring 2.0 to Spring 2.5 at Sebastiano Armeli's Tech Blog.

meta

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: