views:

118

answers:

1

I have a Spring configuration file spring-idol.xml with the following namespace declaration:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans  
  http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"&gt;

     ....

</beans>

I want to add the namespace declaration for AOP

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop 
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"&gt;

    ...

</beans>

Is there a way to do it using Spring IDE? Right now, the only way I can think of is by making a new spring configuration file with the aop namespace declaration and then copy and pasting the declaration from there to the configuration file where my beans are.

A: 

Open with -> Spring Config Editor provides you with a tabbed view. One of the tabs is the namespaces tab, where you can add additional namespaces. There you can choose versioned or non-versioned schema files for aop, context, util, batch etc

btw. if you want to add non-spring namespaces (e.g. for apache cxf) use Open with -> XML Editor and do edit namespaces on the root element

seanizer