My eclipse5.5 添加xml 模板

Myeclipse5.5本身只有四个xml模板
1、Default XML template,
2、XML template for a web.xml,
3、XML template for a web.xml file with Struts ,
4、XML template for a struts-config.xml
如果我们想新建一个xml文件,而没有这样一个模板时这时候就可以自己加一个模板进去。这样以后开发就不用记那样条目了。
现举例加入ejb的weblogic-ejb-jar.xml配置文件的模板
如图:

­
1、打开打开目录myeclipse\eclipse\plugins\com.genuitec.eclipse.wizards_5.5.1
其中涉及文件为:templates.xml,这是一个模板的配置文件
打开可以见到:
<!-- XML templates -->
<template
  context="com.genuitec.eclipse.wizards.xml"
  script="templates/xml/Xml.vtl"
  name="Default XML template"/>
<template
  context="com.genuitec.eclipse.wizards.xml"
  script="templates/xml/WebXml.vtl"
  name="XML template for a web.xml file"/>
<template
  context="com.genuitec.eclipse.wizards.xml"
  script="templates/xml/WebXmlStruts.vtl"
  name="XML template for a web.xml file with Struts"/>
<template
  context="com.genuitec.eclipse.wizards.xml"
  script="templates/xml/StrutsConfig.vtl"
  name="XML template for a struts-config.xml file"/>
这既为在Eclipse中向导中出现的项目.
2、现在手工进行更改配置文件,在其中加入:
<template
  context="com.genuitec.eclipse.wizards.xml"
  script="templates/xml/weblogic-ejb-jar.vtl"
  name="XML template for a weblogic-ejb-jar.xml file"/>
意为添加一项,模板文件是templates/xml目录下的weblogic-ejb-jar.vtl文件
3、加入模板文件
  在templates/xml目录下新建一个"weblogic-ejb-jar.vtl"文件:(可以复制原有的模板文件然后在修改)
#*---------------------------------------------#
# Template for a weblogic-ejb-jar file
# @version: 1.0
# @date: 04/17/2009
# @author:
#---------------------------------------------#
*#<?xml version="1.0" encoding="$encoding"?>
<weblogic-ejb-jar http://www.bea.com/ns/weblogic/90">http://www.bea.com/ns/weblogic/90" xmlns:http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLhttp://www.bea.com/ns/weblogic/90">http://www.bea.com/ns/weblogic/90http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsdhttp://java.sun.com/xml/ns/j2eehttp://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
  <weblogic-enterprise-bean>
    <ejb-name>ejbname</ejb-name>
    <jndi-name>jndiname</jndi-name>
  </weblogic-enterprise-bean>
</weblogic-ejb-jar>
­
4、完成.重启Eclipse即可见到效果。
­
如果想添加jsp ,html,xhtml, Applet Java Class等都可以这样添加。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值