With the imminent release of Spring IDE 2.0.3 we are going to introduce two new features that I’m going to outline in this post.
Support for the import Element
Probably the most requested feature to add to Spring IDE is supporting <import /> elements in Spring configuration files. Up to now imports have been ignored by Spring IDE’s internal parser due to some limitations we had with the way Spring Core handled the processing of imports and the non-trivial task of porting scanning facilities for the classpath*: protocol over to the Eclipse OSGi runtime.
With Spring IDE 2.0.3 which will be released today we finally managed to add support for imports. So after upgrading to 2.0.3 you will eventually notice a new setting on the preference page that allows to explicitly enable the import support (see screenshot below).
After enabling the import support you might end up with error messages like: Overrides another bean ‘X’ in config set ‘Y’. That can occur if you are using an Beans Config Set to group configuration files in order to simulate the runtime behavior of imports. The error is due to the fact that one configuration file imports another file that is also part of the same config set and is now being added to the set multiple times: using an import and directly using the preference page.
To get rid of that you need to either ‘Enable Bean Override’ in the Config Set preference page or remove the configuration files from the config set. There might not even be the need for a config set any more.
Detection of Tooling Annotations in Namespace Schemas
Since the Introduction of the XSD-based configuration style in 2.0 of Spring a tooling specific namespace has been available. The <tool:* /> namespace defines meta data that can be used to annotate your own custom namespaces elements. These annotations are good to describe that a configuration element exposes a bean of a certain type or that an attribute takes class or interface names or bean references.
Spring IDE 2.0.3. will look for those annotations and automatically provide content assist and hyperlinking in the XML editor and create beans in the Spring structure model displayed in the Spring Explorer and used during validation. There is no need to implement a custom Eclipse plug-in to get support for an extension namespace.
You can see an example of tool annotation usage in the oxm namespace of Spring Web Services.

In order to read the annotations Spring IDE looks up XSD schema files from the Eclipse XML Catalog. Therefore it is important that the XSD is known in the catalog and recognized by the XML editor. You can easily test if the schema is correctly installed by using code completion on the custom namespace elements or attributes.





Recent Activity
benyan, Axel Mendoza Pupo, Christian Dupuis, Ryan Ovrevik, Jeremy D. Young, Tareq
Ricardo
Tony, James, Radek, Radek, jack, nicholas, cj, spinbox, Brad, Brad [...]
Sam, Petri Sirkkala, en3rgizer
hesy, Propecia, Jon, prande, Brice
joshmerry, IGC, guddu, antonio, Narada, Rakesh, Christian Dupuis, Christian Dupuis, Who Ever, KingSun [...]