SpringIDE - Using Spring in Eclipse
Spring Explorer
If you go to the Spring Explorer view, through Window/Show View/Other... you can add Config Files, and Config Sets, to view and validate. As you will see in this dialog there are other views available too

In this view you can easily add in Config Sets or single Config Files. If you right click on the Config File and choose View Graph, you get to see a nice representation (using Eclipse's GEF)
of your Spring configuration file - in this example there's not a whole load to see, but in more complicated
configuration this can be very useful.

You can also easily validate your XML, to ensure there's no typos or bad XML in there, with the results displayed
in the Problems View.
Definitions
I don't want to make assumptions of the knowledge levels of any readers, so the following are some brief definitions of technolgies and terms that I have mentioned over the course of this article.
Spring
Spring is a layered Java/J2EE framework. It can be used in any J2EE server, and you can also use it in standalone Java applications, to use some of it's techniques in your own code. So, Spring is a lightweight container for configuration and wiring of application objects.
Typically it's used as an alternative to EJB. As an MVC framework, it supports many technologies for generating views
(JSF, Velocity, Tiles).
Spring Web Flow
Spring Web Flow is a web application controller framework, allowing the modelling of user actions as high-level modules called flows, runnable in any environment.
Steven Devijver has written a great article explaining what Web Flow actually provides and how it works. The project page also provides a good overview.
Aspects
The aim of Aspect Oriented Programming is to aid programmers in the seperation of concerns - breaking a program
into distinct pieces of functionality - improving modularity of code.
The best example of AOP is logging, where a logging module could crosscut existing code.
Thus, AOP provides a good level of maintainability. To find out more, the AspectJ page is a good start.
Spring AOP
Spring AOP is integrated into the Spring configuration, so that you can AOP-enable any object that is managed by the container, allowing you to have aspects in your code, without the traditional AspectJ compiler.
GEF
The Eclipse Graphical Editing Framework (http://www.eclipse.org/gef/) allows developers to take an existing application model and create a rich graphical editor from it. GEF uses an MVC architecture enabling simple changes to be applied to the model from the view.
Struts & Spring
The following is a good article dealing with integrating your Struts application with Spring.
Spring isn't the type of framework to replace something like Struts, more like it compliments it.
- « first
- ‹ previous
- 1
- 2
- 3
James is a DZone Zone Leader and has posted 231 posts at DZone. You can read more from them at their website.
- Login or register to post comments
- 95926 reads
- Printer-friendly version
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)










Comments
vsudip replied on Thu, 2008/07/31 - 4:57am
Hi,
I am not able to download the springID update, so caould not process furthe.Can anybody help regarding this?
gihrig replied on Tue, 2008/08/19 - 5:55pm
There seems to be a growing recognition among tutorial authors that Spring is in need of a light-weight introduction. This is a very good sign as it suggests that Spring may truly be accessible to the 'every-day' Java developer, shattering the common belief that frameworks (including Spring) are for enterprise gurus. (Silly developers ;-)
This is the third basic Spring tutorial I have attempted, and the first I have been able to get working. Thanks - I now have reason to believe that I too will realize the benefits of Spring.
This tutorial does have a few issues that had me wondering if I was ever going to get the tutorial, and Spring, to work. Here are the problems I encountered and the solutions that got it working for me.
Creating a New Project
There is no instruction, beyond "use the New Spring Project wizard" on how to start this wizard. Some familiarity with Eclipse is assumed. Of course, a greater knowledge than this will be required to work with Java and Spring later on. Still File->New->Other opens the screen shot shown in the tutorial.
No Project Name is provided. A project name of SpringTest is expected in later steps. Not knowing this caused me a lot of confusion and frustration, when I mistook "SpringTest" to mean ...com/eclipsezone/spring/test.
The paragraph on required libraries could be clearer. The required libraries and their locations (as of Spring 2.5.5) are:
Object Creation
The text has no indication where to put the ISampleBean interface code. The following screen shot on creating the SampleBean class shows the Source folder and Package which describe this.
The SampleBean class is incorrectly named "SamplebeanImple" in the screen shot. It is later referred to as SampleBean.
Create a New Bean Definition File
Placing this file in the project root directory "SpringTest" is vital.
Not knowing this caused me a lot of confusion and frustration, when I mistook "SpringTest" to mean
The correct action is: Right click the project root folder, "SpringTest", and select New->Other->Spring->Spring Bean Definition to create the Spring Bean Definition file.
There is a minor typo following the XSD namespace declarations screen shot.
... As we are only using on configuration file, Should be:
... As we are only using one configuration file,
Add Method Interceptor
The code will not compile as listed for class Interceptor. The annotation is wrong and should be removed.
Not a problem with the tutorial, but I was unable to get the beanDefinition xml editor to change the value associated with "value" elements.
Right clicking the value element provides no "Edit Attribute" function.
The solution I used was to open the beanDefinition.xml file in Source view with the tab at the lower left corner of the editor window, and paste in the code from the tutorial.
Spring Explorer
The paragraph following the Show View screen shot would benefit from a little reorganization:
In this view you can easily add in Config Sets or single Config Files. If you right click on the Config File and choose View Graph, you get to see a nice representation (using Eclipse's GEF) of your Spring configuration file ...
Suggest:
If you right click on the Config File in this view and select Properties, you can easily add in Config Sets or single Config Files. Choose Open Graph, and you get to see a nice representation (using Eclipse's GEF)
of your Spring configuration file ...
--------------------
The bottom line is, I got my first working understanding of Spring AOP and Interceptors from this tutorial and I am grateful for that.
Four stars (would be worth five with the above issues fixed).
Thanks!
-Glen
William Willems replied on Mon, 2008/11/17 - 8:30am
GZI replied on Mon, 2009/04/27 - 4:38am
in response to: vsudip
swatimalla replied on Wed, 2009/09/02 - 1:30am
Hello EveryOne,
I tried to download springIDE from the follwoing link (http://springide.org/updatesite-dev).When i click on this link it gives an error back saying
<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>release/IDE-dev</Key>
<RequestId>536B0F024044807C</RequestId>
−
<HostId>
30YvYelUJVb04zlb6uM+2FSFx+xK8/+xh2x6/Z/VLvQwhzqL0fOeaIdFrDhgXs18
</HostId>
</Error>
Please can someone send me the plgin if some body has it..
I would really apprecitae if some one can send me a reply back..
Thanks,
swati
sachintodkarus@... replied on Fri, 2009/10/30 - 12:23pm
sachintodkarus@... replied on Fri, 2009/10/30 - 1:05pm
in response to: sachintodkarus@yahoo.com