Skip to main content


developerWorks  >  WebSphere | Open source  >

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

Develop and deploy a sample application using the Spring MVC framework

developerWorks

Level: Intermediate

Sunil Patil (spatil@atech.com), Software Engineer, Ascendant Technology LLC

28 Feb 2007

Register now or sign in using your IBM ID and password.

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.

Objectives

  • Learn how to develop Spring applications that you can use with IBM WebSphere Application Server Community Edition.

  • Get familiar with database connection management options available to you while developing Spring applications.

  • Learn 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.

  • See how Spring makes it easy to switch from one connection pool implementation to another without making any changes in your Java code.

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. (If you're new to the Spring Framework, Arun Chhatpar's "Apache Geronimo and the Spring Framework" series here on developerWorks is an excellent place to get started.)


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.



Duration

Under 2 hours


Formats

html, pdf


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!


Back to top


Document options

Document options requiring JavaScript are not displayed


My developerWorks needs you!

Connect to your technical community


More in this series:
Develop Spring applications for WebSphere Application Server Community Edition