日期:2014-05-18  浏览次数:20675 次

eclipse 新建applicationContext.xml文件
以前使用spring框架,创建applicationContext.xml文件总是从别的项目中拷贝过来。这次想自己新建一个applicationContext.xml文件,步骤如下:新建-》other->xml->xml File->next->create XML file from an XML schema file ->select xml catelog entry->选中需要的xsd,生成xml文件如下:

<?xml version="1.0" encoding="UTF-8"?>
<p:beans xmlns:p="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-3.2.xsd ">

</p:beans>

请问prefix p如何在去除,我看其他项目中的applicationContext.xml文件都没有这个prefix。

------解决方案--------------------
不一定要myeclipse自动生成,有时候自动生成的也不一定完整的。最好还是复制spring源码中的xml为宜。