Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Develop Spring applications for WebSphere Application Server Community Edition, Part 1: Spring MVC

Develop and deploy a sample application using the Spring MVC framework

Sunil Patil (spatil@atech.com), Software Engineer, Ascendant Technology LLC
Sunil Patil is a software engineer with more than seven years of experience. His interests include Spring, Struts, and various object relational mapping frameworks, such as Hibernate and iBatis.

Summary:  If you're at all active in the Java™ community, or even if you just read Java-related online magazines or blog sites, you've probably heard of the Spring Framework, which has gained a lot of attention in the past few years. Now's your chance to try it out! This multipart tutorial series shows you how to develop Spring applications that you can use with IBM® WebSphere® Application Server Community Edition, a free, lightweight Java 2 Platform, Enterprise Edition (J2EE) application server. This installment introduces you to various database connection management options available to you while developing Spring applications. Learn about Spring's own implementation of DataSource, how to use an open source connection pool implementation, and how to use connection pools maintained by WebSphere Application Server Community Edition from your Spring application. Also, find out how Spring makes it easy for you to switch from one connection pool implementation to another without making any changes in your Java code.

View more content in this series

Date:  28 Feb 2007
Level:  Intermediate PDF:  A4 and Letter (161 KB | 21 pages)Get Adobe® Reader®

Activity:  19224 views
Comments:  

Before you start

Spring is a layered Java Platform, Enterprise Edition (Java EE) application framework hosted on the Spring Framework Web site (see Resources for a link). It was developed by Rod Johnson as a code for his famous book, Expert one-on-one J2EE design and development. It's aimed at making Java EE project development easier by providing infrastructure code required by most of the Java EE application. You can think of Spring as a best practices implementation tool.

About this tutorial

In this first installment of the series, you'll develop a sample application using the Spring MVC framework and deploy it on WebSphere Application Server Community Edition. The sample application familiarizes you with various concepts, such as how a request is processed under the hood and how to handle form submissions. You'll also learn what changes are required if you're using Jakarta Commons as the logging framework in your application.


Prerequisites

To follow along with this tutorial you should have a basic understanding of the following:

  • Object-oriented programming
  • Java EE terminology
  • XML semantics
  • JSP tags, tag libraries, and tag library descriptors

This tutorial assumes that you're an experienced Java EE developer, familiar with the basics of the Spring Framework. An understanding of Model-View-Controller (MVC) is a plus, but isn't required. Although no advanced knowledge is required, you should be familiar with how to use the Spring BeanFactory and the Spring AOP.


System requirements

You need to download several required applications to follow along with this tutorial and work with the sample code included:

  • JDK 1.4.2 -- WebSphere Application Server Community Edition is currently using the Sun Microsystems implementation of Object Request Broker (ORB) for Remote Method Invocation (RMI), so it requires Sun's JDK. You use JDK 1.4.2 to test the sample code in this tutorial.
  • WebSphere Application Server Community Edition -- Sample code in this article is tested using version 1.1. If you decide to use some other version of WebSphere Application Server Community Edition, you may have to make some changes in the geronimo-web.xml file.
  • Spring Framework -- Use the compressed file with all dependencies. Note: If you don't download the Spring version with all dependencies, then you'll have to download other required JAR files manually. Version 2.0 of the Spring Framework was used while developing the sample code in this article.
  • The Eclipse Web Tools Platform (WTP) 1.0.1 -- This open source project makes your Java EE development easy by providing easy-to-use wizards for creating servlets, JavaServer Pages (JSP) components, and Enterprise JavaBeans (EJBs). It also provides editors for JSP and XML. Take a look at the Resources section to find more information on how to use this tool.
  • The WebSphere Application Server Community Edition server adapter (formerly called the Eclipse plug-in for WebSphere Application Server Community Edition) -- This server adapter lets you interact with WebSphere Application Server Community Edition from within Eclipse. You can do things like start or stop the server, or start it in normal or debug mode. The server adapter also allows you to run and debug your project on the server by simply right-clicking on a project and choosing Run on Server or Debug on Server. I think this adapter solves one of the biggest problems in open source projects, which is a lack of development tools.

I suggest that you use the Eclipse Web Tools Platform combined with the Eclipse plug-in for WebSphere Application Server Community Edition as your development environment, though it's not required. You can use another editor of your choice. If you do, you can use the Ant build script provided with this sample to build your source code.

1 of 8 | Next

Comments



Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere, Open source
ArticleID=199111
TutorialTitle=Develop Spring applications for WebSphere Application Server Community Edition, Part 1: Spring MVC
publish-date=02282007
author1-email=spatil@atech.com
author1-email-cc=pppsunil@gmail.com

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.