在MyEclipse for mac 中增加、修改JSP模板

修改模板: 
找到com.genuitec.eclipse.wizards_9.0.0.me201108091322.jar,至少格式是前缀是一样,每个版本不一样,我的是myeclipse10. 
然后用war软件打开。 
新建一个Struts2_jsp.vtl 

Struts2_jsp.vtl 
------------------------------------- 
Jsp代码   收藏代码
  1. <%@ page language="java" import="java.util.*"  pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>  
  2. <%@ taglib prefix="s" uri="/struts-tags"%>  
  3. <%  
  4.     String titleString = "My Struts2 JSP Template";  
  5.     String footerString= "My Struts2 JSP Template";  
  6.     String path = request.getContextPath();  
  7.     String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
  8. %>  
  9. <html>  
  10.     <head>  
  11.         <title><%=titleString%></title>  
  12.     </head>  
  13.     <body>  
  14.         <center><h1><%=titleString%></h1></center>  
  15.         <hr>  
  16.         <%=new Date()%><br>  
  17.         Actionerror:<s:actionerror/><br>  
  18.         Actionmessage:<s:actionmessage/><br>  
  19.         <hr>  
  20.         <div style="height:100%;border:1px solid #6699FF">  
  21.             <s:form action="myAction" method="post">  
  22.                 <s:textfield name="user" label="UserName" value="default value" size="50"></s:textfield>  
  23.                 <s:submit value="Submit"></s:submit>  
  24.             </s:form>  
  25.         </div>  
  26.         <hr>  
  27.         <center><%=footerString%></center>  
  28.     </body>  
  29. </html>  




然后把这个文件放到jar里面的com.genuitec.eclipse.wizards_9.0.0.me201108091322.jar\templates\jsp 
然后回到com.genuitec.eclipse.wizards_9.0.0.me201108091322.jar最外面的,看见templates.xml 
解压出来,然后在<!-- JSP templates -->的后面增加如下代码: 
Xml代码   收藏代码
  1. <template  
  2.         context="com.genuitec.eclipse.wizards.jsp"  
  3.         script="templates/jsp/Struts2_jsp.vtl"  
  4.         name="Standard JSP using Struts 2.X with a form"/>  


保存之后,在放到war打开的jar一样的地方那个,覆盖里面的文件。 
然后启动myeclipse,点new/jsp   然后就能选择刚才的模板了。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值