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

来源:互联网 发布:天猫淘宝投诉电话 编辑:程序博客网 时间:2024/06/14 10:55

     最近在看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即可。


0 0
原创粉丝点击