<?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:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd">
</beans>
代码中task部分是要添加的命名空间。
如何找到?
在spring-context包中
打开spring-task.xsd
还有一种方式是:在idea14中,xml写上
<task:executor id="executor" pool-size="5" />键盘alt+enter,会自动添加命名空间。
另外,spring官方提供的xml基础schema配置:http://docs.spring.io/spring/docs/current/spring-framework-reference/html/xsd-configuration.html#xsd-config-body-schemas-jdbc