开发者

adding a new namespace declaration to a spring config using Spring IDE

开发者 https://www.devze.com 2022-12-10 22:20 出处:网络
I have a Spring configuration file spring-idol.xml with the following namespace declaration: <?xml version=\"1.0\" encoding=\"UTF-8\"?>

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">

     ....

</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">

    ...

</beans>

Is there a way to do it using Spring IDE? Right now, the only way I can think o开发者_如何学运维f 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消