JavaBeat
Search JavaBeat

JAVABEAT
home
articles
tips
QnA
Books
forums
ARTICLE TOPICS
All Articles
Java 5.0
Java 6.0
EJB 3.0
JCA
Struts
JSF
Spring
Groovy
JBoss Seam
Hibernate
Eclipse
JavaFx
Google Guice
J2ME
GWT
WebServices
AJAX
ARCHIVE
2007 | 12 11 10 09 08 07 06 05 04 03
2008 | 07 06 05 04 03 02 01
CERTIFICATION KITS
350 SCJP 1.5 Mock Exams
400 SCJP 1.6 Mock Exams
300 SCWCD 5.0 Mock Exams
300 SCBCD 5.0 Mock Exams
Enter email address:

Latest JavaBeat Articles Delivered by FeedBurner
OUR NETWORK
javabeat
planetoss
Sponsors
Java Jobs eCommerce software Get Ubuntu 8.04 Get FireFox 3.0  

Pages : 1 2 3 4 5

Integrating Struts With Spring

Author : MunafSahaf
Date : Sun May 13th, 2007
Topic : spring struts 
Enter email address:

Latest JavaBeat Articles Delivered

Introduction

Struts is more established and more stable MVC2 framework at this time so if your application is based on Struts framework you may forget about thinking to move to some other framework. But at the same time you must have heard about the buzz created by Inversion of Control (IOC) design pattern. This design pattern is implemented by Spring framework. Besides there are some more amazing features of Spring like AOP. So if you like to take advantage of these features of Spring you do not have to rebuild the application, but you can integrate your existing Struts application with Spring without much hassle. More about that latter but first we would like to have a look at new features of Spring and how they work.

What's new in Spring?

Spring implements the IOC design pattern. It is a lightweight container and the objects are managed using an external XMl configuration file. Reference to a dependent object is obtained by exposing a JavaBean property. You just have to enter the properties in the external XML file.

Spring and IOC

IOC is a design pattern that externalizes application logic so that it can be injected into client code rather than written into it. Use of IOC in Spring framework separates the implementation logic from the client.

Spring framework offers more than this. The transaction handling is done beautifully in Spring. It can integrate major persistence frameworks and offer a consistent exception hierarchy. The best part of Spring is the mechanism of aspect-oriented code instead of the usual object-oriented code.

Spring AOP provides us with interceptors which are used to intercept the application logic at any execution point and then apply some methods at the interceptors. They are widely used for logging resulting in a more readable and functional code.

Advantages of integrating Struts with Spring:

The advantages of integrating a Struts application into the Spring framework are:

  1. Spring framework is based on new design approach and was designed to resolve the existing problems of existing Java applications such as performance.
  2. Spring framework lets you apply AOP (aspect-oriented programming technique) rather than object-oriented code.
  3. Spring provides more control on struts actions. That may depend on the method of integration you choose.

 
Pages : 1 2 3 4 5
 

Sponsors
Webmaster Hosting Forum
Java Jobs
MyVideoLib
India News
Internet Advances
Latest QnA
SCJD Tips
When we start a thread by applying start() method on it ,how does it knows that to execute run()method?
About Wrapper class in Java
How to configure weblogic 7.0 in MyEclipse?
Static Block and Static Initializer in Java

JavaBeat Media (2004-2008), India
javabeat | planetoss | links directory | advertise
Copyright (2004 - 2008), JavaBeat