Tiles傻瓜式入门―hajavaor―
来源:互联网 发布:mac book pro 壁纸 编辑:程序博客网 时间:2024/05/16 15:46
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
Tiles傻瓜式入门―hajavaor―//=========================== Author:hajavaor Email:hajavaor@eyou.com QQ:19843788//===========================0、适用读者:了解Tag lib,使用Struts(当然了,Tiles属于Struts嘛。) 1、有一个文件,名为test.jsp。内容如下: <html><body>This is the header.</body></html> <html><body>This is the body. </body></html> <html><body>This is the footer. </body></html>2、拆此文件为三个文件,分别为: test_header.jsp <html><body>This is the header.</body></html> test_body.jsp <html><body>This is the body.</body></html> test_footer.jsp <html><body>This is the footer.</body></html> 3、修改test.jsp文件,使用Tiles标签。这便是我的第一个Tiles例子了。 <Tiles:insert page="test_header.jsp"/> <Tiles:insert page="test_body.jsp"/> <Tiles:insert page="test_footer.jsp"/> 由原来的一个文件变成了四个文件。继续看。 4、将上面的文件再换成下面两个文件: test_template.jsp,这是一个模板文件。 <html:html> <head><title></title></head> <body> <Tiles:insert attribute="header"/> <Tiles:insert attribute="body"/> <Tiles:insert attribute="footer"/> </body> </html:html> 将test.jsp改成这样: <Tiles:insert page="/test_template.jsp" flush="true"> <Tiles:put name="header" value="/test_header.jsp" /> <Tiles:put name="body" value="/test_body.jsp" /> <Tiles:put name="footer" value="/test_footer.jsp" /> </Tiles:insert> 5、再进一步修改,编辑一个Tiles-defs.xml文件,内容为: <definition name="MyTilesTest" path="/test_template.jsp"> <put name="header" value="/test_header.jsp" /> <put name="body" value="/test_body.jsp" /> <put name="footer" value="/test_footer.jsp" /> </definition> 修改test.jsp文件内容为: <Tiles:insert definition name="MyTilesTest" /> 就变成一句代码了,很简洁吧。 怎么样,你知道Tiles是怎么回事了吧,就算入门了,赶紧看Tiles的API吧。 本文的目的只是让你建立Tiles的概念,而具体如何使用,请看相关文档。<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- Tiles傻瓜式入门―hajavaor―
- Tiles傻瓜式入门―hajavaor―
- Tiles傻瓜式入门
- Android_GreenDao傻瓜式入门
- 傻瓜式入门blazeDS(完整)
- Struts学习傻瓜式入门篇
- Struts学习傻瓜式入门篇
- Struts学习傻瓜式入门篇
- Struts学习傻瓜式入门篇
- Struts学习傻瓜式入门篇
- Struts学习傻瓜式入门篇
- seajs 2.3.0 傻瓜式入门
- 前端傻瓜式入门No.1
- 前端傻瓜式入门No.2
- Android入门图片缓存(傻瓜式)
- maven项目创建入门【傻瓜式教程】
- Spring MVC + Tiles 入门
- AutoTools 傻瓜入门
- SQL十进制转二进制和十六的两个函数
- Sun ONE Application Server 开发者指南(19)
- resin中文乱码的又一个解法
- 中国程序员的现状
- BOXLIGHT西安展会总结
- Tiles傻瓜式入门―hajavaor―
- 使用tomcat的manager功能的试验与体会
- java程序转成exe文件
- Struts 原理与应用(一)
- JDO+JSP2.0开发Web应用向导 - 开发篇
- 深度探索Java RMI远端对象传递技术
- 我的Java学习历程
- 用jdom轻松整合java和xml(三)
- JAVA日期和时间类彻底解决(1)