您的位置:首页 > 编程语言 > Java开发

myeclipse 自定义xml模板,供新建xml文件时自动导入

2014-09-19 14:22 232 查看
最近在看spring in action ,在配置bean的xml文件时,要加入长长的名字空间描述,如:

<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-3.0.xsd">
为了避免每一次新建项目时,手动输入这些配置文件,可以自定义xml模板文件,便于自动导入,方法如下:

1、Myeclipse下选择Window -> preferences -> MyEclipse -> Files and Editors -> XML -> XML Templates,在右边对话框中选择

new,进入新建对话框,填写name(自己定义),context下拉条选择New XML,Description中自定义描述内容,在Pattern中输入

自定义的配置xml模板内容,点击OK,完成。

在使用时,选择New -> XML(Basic Templates) -> next -> create XML file from an XML template -> next ,选择自定义的模板name即可。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: