﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-sealyu-文章分类-Struts</title><link>http://www.blogjava.net/sealyu/category/30734.html</link><description /><language>zh-cn</language><lastBuildDate>Sat, 19 Apr 2008 18:47:24 GMT</lastBuildDate><pubDate>Sat, 19 Apr 2008 18:47:24 GMT</pubDate><ttl>60</ttl><item><title>Struts预定义的三种重要Action类（转载） </title><link>http://www.blogjava.net/sealyu/articles/194236.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Sat, 19 Apr 2008 13:01:00 GMT</pubDate><guid>http://www.blogjava.net/sealyu/articles/194236.html</guid><wfw:comment>http://www.blogjava.net/sealyu/comments/194236.html</wfw:comment><comments>http://www.blogjava.net/sealyu/articles/194236.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/sealyu/comments/commentRss/194236.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/sealyu/services/trackbacks/194236.html</trackback:ping><description><![CDATA[<ul>
    <li style="font-weight: bold">DispatchAction:一个Action 完成多个动作<br />
    <li style="font-weight: bold">MappingDispatchAction(主要用他):一个Action 完成多个动作，优点：思路清晰
    <li><span style="font-weight: bold">LookupDispatchAction:用于一个表单多个提交按钮。</span> </li>
</ul>
注意：在使用继承Struts预定义的Action类，一定不要覆盖execute方法，否则会导致无法调用自定义Action相应方法。<br />
<br />
DispatchAction类(org.apache.struts.actions.DispatchAction)<br />
<br />
DispatchAction类是Action类的子类，他提供了有实现的execute方法。<br />
<br />
我们写的自定义Action类，可以继承DispatchAction类，但不要覆盖execute方法，可以在自定义类中写反回值和参数表都与execute方法相同的方法，可以通过在struts-congfig.xml中为这个action的配置中添加一个参数，来判断调哪一个方法，实际上DispatchAction类就是通过反射机制，通过form中参数调用了自定义Action中的方法，当然这些方法的定义要符合规范，使用继承DispatchAction类的自定义的Action类，也就会共享同一的Action路径。<br />
<br />
注意：使用继承DispatchAction类的自定义的Action，只会匹配一个action路径，只能共享一个ActionForm，如果加上校验，会产生form表单的参数不一致的情况，会导致校验无法通过。<br />
<br />
<br />
例：<br />
public class MyAction extends DispatchAction{<br />
&nbsp;&nbsp;&nbsp; ActionForward add(ActionForm form,HttpServletRequest request,HttpServletResponse&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; response ActionMapping mapping) throws Exception<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return mapping.findForward("sucess")&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
}<br />
<br />
&lt;action path="/add"&nbsp; type="MyAction" parameter="methodName"&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;!--parameter属性是和form中隐藏域的名字相对应的--&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;forward name="sucess" path="/sucess.jsp"/&gt;<br />
&lt;/action&gt;<br />
<br />
&lt;from action="add.do" method="post"&gt;<br />
&nbsp;&nbsp; &lt;input type="hidden" name="methodName" value="add"/&gt;<br />
&nbsp;&nbsp; &lt;!--<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 使用隐藏域为struts传递要调用自定义Action中方法的方法名，是通过与struts-config.xml<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 中action标签中的parameter和name属性相对应来获取隐藏域的value。<br />
&nbsp;&nbsp; --&gt;<br />
&nbsp;&nbsp; &lt;input type="submit" value="submit"/&gt;<br />
&lt;/from&gt;<br />
<br />
MappingDispatchAction类(org.apache.struts.actions.MappingDispatchAction)<br />
<br />
MappingDispatchAction类是DispatchAction的子类，他和DispatchAction不同点就是可以去匹配多个action路径，这样也就是结决了共用ActoinForm的校验问题了，多个Action的路径使用同一的自定义Action类，这样就不用共享同一个ActionForm，也就不会有校验问题了。<br />
<br />
<br />
例：<br />
public class MyAction extends MappingDispatchAction{<br />
&nbsp;&nbsp;&nbsp; ActionForward add(ActionForm form,HttpServletRequest request,HttpServletResponse&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; response ActionMapping mapping) throws Exception<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return mapping.findForward("add")&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ActionForward del(ActionForm form,HttpServletRequest request,HttpServletResponse&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; response ActionMapping mapping) throws Exception<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return mapping.findForward("del")&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
}<br />
<br />
&lt;action path="/add"&nbsp; type="MyAction" parameter="add"&gt;<br />
&nbsp;&nbsp; &lt;!--parameter属性是指定调用方法的名字--&gt;<br />
&nbsp;&nbsp; &lt;forward name="add" path="/add.jsp"/&gt;<br />
&lt;/action&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&lt;action path="/del"&nbsp; type="MyAction" parameter="del"&gt;<br />
&nbsp;&nbsp; &lt;forward name="del" path="/del.jsp"/&gt;<br />
&lt;/action&gt;<br />
<br />
在JSP页面中也不用在使用隐藏域传递参数，直接在form中的action中就可以直接使用xxx.do匹配了。<br />
&lt;form action="add.do" method="post"&gt;<br />
&nbsp;&nbsp; &lt;input type="submit" value="submit"/&gt;<br />
&lt;/form&gt;<br />
&lt;form action="del.do" method="post"&gt;<br />
&nbsp;&nbsp; &lt;input type="submit" value="submit"/&gt;<br />
&lt;/form&gt;<br />
<br />
LookupDispatchAction(org.apache.struts.actions.LookupDispatchAction)<br />
<br />
LookupDispatchAction类也是DispatchAction类的子类，他所实现的功能是解决一个表单多种提交问题的<br />
，他是通过使用资源文件，用submit按钮的value来作为资源文件中的key所对应的值，通过这个值来找到对用的key，在使用这个key来获得指定Map中所对应的值，这个值就是要调用的方法名。<br />
<br />
submit的value----&gt;MessageResource.properties中的key-----&gt;Map中key对相应的值----&gt;action<br />
<br />
例：<br />
&lt;%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %&gt;<br />
<br />
&lt;form method="post" action="${pageContext.request.contextPath}/lookup/adddel.do"&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;input type="submit" value="&lt;bean:message key="button.add" /&gt;" name="methodName"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!--注意name="methodName"是和strut-config.xml中action标签中的parameter属性--&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;input type="submit" value="&lt;bean:message key="button.delete" /&gt;" name="methodName"&gt;<br />
&lt;/form&gt;<br />
<br />
MessageResource.properties<br />
<br />
button.add=add new user<br />
button.delete=delete user<br />
<br />
注意：在继承LookupDispatchAction时，要覆盖getKeyMethodMap()方法，并定义Map，向Map中放入指定的键值对。<br />
<br />
public class AddDelLookupDispatchAction extends LookupDispatchAction<br />
{<br />
&nbsp;&nbsp;&nbsp; public Map getKeyMethodMap(){<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Map keyMethodMap= new HashMap();<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; keyMethodMap.put("button.add", "add");<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; keyMethodMap.put("button.delete", "delete");<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return keyMethodMap;<br />
&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; public ActionForward add(ActionMapping mapping,ActionForm form,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HttpServletRequest request,HttpServletResponse response) throws Exception<br />
&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return mapping.findForward("add");<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; public ActionForward delete(ActionMapping mapping,ActionForm form,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HttpServletRequest request,HttpServletResponse response) throws Exception<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return mapping.findForward("delete");<br />
&nbsp;&nbsp;&nbsp; }<br />
}<br />
<br />
&lt;action&nbsp;&nbsp; path="/lookup/adddel"&nbsp; type="alan.struts.actions.AddDelLookupDispatchAction"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; parameter="methodName"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;forward name="add" path="/add.jsp"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;forward name="delete" path="/delete.jsp" /&gt;<br />
&lt;/action&gt;<br />
&lt;message-resources parameter="alan.struts.message.MessageResource" /&gt;<br />
<br />
自定义的Action类的一些规则<br />
1，尽量不要在Action类中使用（静态）成员变量，如果使用要加上同步。<br />
2，尽量使各模块间的耦合性降低，最大限度的针对接口编程。<br />
3，可以将共代码方在覆盖父类的方法中，最后可以用super.xxx(xxx)来调用父类的方法，使用父类的实现，并加上了自定义的功能。<br />
<img src ="http://www.blogjava.net/sealyu/aggbug/194236.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/sealyu/" target="_blank">seal</a> 2008-04-19 21:01 <a href="http://www.blogjava.net/sealyu/articles/194236.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在struts用重定向解决重复刷新而多次重复的提交表单的问题  </title><link>http://www.blogjava.net/sealyu/articles/194234.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Sat, 19 Apr 2008 12:56:00 GMT</pubDate><guid>http://www.blogjava.net/sealyu/articles/194234.html</guid><wfw:comment>http://www.blogjava.net/sealyu/comments/194234.html</wfw:comment><comments>http://www.blogjava.net/sealyu/articles/194234.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/sealyu/comments/commentRss/194234.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/sealyu/services/trackbacks/194234.html</trackback:ping><description><![CDATA[<div class="postText">在用分派action的时候，我有两个页面addnews.jsp、listnews.jsp，在NewsAction.java中有两个方法：addNews(),listNews()。当我在addnews.jsp中提交表单到action中的addNews()中，在里面我执行完插入数据库的操作以后，我希望转向到listnews.jsp中，所以一般想到的都是写：return listNews(mapping, form, request, response);然后再listNews（）方法中我执行了查询数据库的操作，最后我再forword到listnews.jsp，这个流程应该是非常清晰的，但是问题出来了，当我们增加新的文章以后，我们返回到列表界面，但是url路径仍然是<a href="http://localhost:8080/newstest/newsAction.do?method=addNews">http://localhost:8080/newstest/newsAction.do?method=addNews</a> 那么这就要出现问题了，当我们不断的刷新页面的时候，我们会发现，列表中增加了很多重复的数据，这是因为刷新url路径时，请求还是从插入数据库的操作开始的，所以一遍遍的执行插入操作，造成了页面的重复提交。<br />
怎么解决呢？我们知道，重定向可以解决页面刷新带来的数据的重复提交的问题，我们自然可以利用重定向的方式来解决这个问题。但是struts的action里面mapping.findword（）；跳转的话，默认的是在工程文件夹里面找要跳转的页面。这种情况，怎么解决呢？<br />
&nbsp;修改struts－config.xml 文件， 在action里面有一个redirect重新定向的属性，struts中默认的是false，添加这个属性，改成true，在forword中写上要跳转页面的绝对或者相对地址就行了<br />
修改如下：<br />
&lt;action-mappings&gt;<br />
&nbsp;&nbsp;&lt;action attribute="newsActionForm" name="newsActionForm"<br />
&nbsp;&nbsp;&nbsp;input="/addnews.jsp" path="/newsAction" parameter="method"<br />
&nbsp;&nbsp;&nbsp;scope="request" type="com.yongtree.news.action.NewsAction"&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;forward name="list" path="/listnews.jsp" redirect="true"&gt;&lt;/forward&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;forward name="error" path="/addnews.jsp"&gt;&lt;/forward&gt;<br />
&nbsp;&nbsp;&lt;/action&gt;<br />
&lt;/action-mappings&gt;&nbsp;<br />
</div>
<div></div>
<table>
    <tbody>
        <tr>
            <td></td>
        </tr>
    </tbody>
</table>
<script type="text/javascript"><!-- google_ad_client="pub-6625678643128649" ; google_alternate_color="FFFFFF" ; google_ad_width="728;
		google_ad_height" = 90; google_ad_format="728x90_as" ; google_ad_type="text_image" ; google_ad_channel="" ;
		//--></script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
		</script>
<img src ="http://www.blogjava.net/sealyu/aggbug/194234.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/sealyu/" target="_blank">seal</a> 2008-04-19 20:56 <a href="http://www.blogjava.net/sealyu/articles/194234.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>详解struts2中struts.properties</title><link>http://www.blogjava.net/sealyu/articles/194233.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Sat, 19 Apr 2008 12:55:00 GMT</pubDate><guid>http://www.blogjava.net/sealyu/articles/194233.html</guid><wfw:comment>http://www.blogjava.net/sealyu/comments/194233.html</wfw:comment><comments>http://www.blogjava.net/sealyu/articles/194233.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/sealyu/comments/commentRss/194233.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/sealyu/services/trackbacks/194233.html</trackback:ping><description><![CDATA[<p>Struts 2框架有两个核心配置文件:<br />
<br />
<font color="#ff0000">&nbsp;&nbsp;&nbsp;&nbsp;struts.xml</font>和<font color="#ff0000">struts.properties</font><br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;其中struts.xml文件主要负责管理应用中的Action映射，以及该Action包含的Result定义等。除此之外，Struts 2框架还包含一个struts.properties文件，该文件定义了Struts 2框架的大量属性，开发者可以通过改变这些属性来满足应用的需求。<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struts.properties文件是一个标准的Properties文件，该文件包含了系列的key-value对象，每个key就是一个Struts 2属性，该key对应的value就是一个Struts 2属性值。<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struts.properties文件通常放在Web应用的WEB-INF/classes路径下。实际上，只要将该文件放在Web应用的CLASSPATH路径下，Struts 2框架就可以加载该文件。</p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;其实，struts.properties文件的内容均可在struts.xml中以<font color="#ff0000">&lt;constant name="" value=""&gt;&lt;/constant&gt;</font>加载。
<p>下面将该文件的配置参数详细列举出来，方便大家查看；</p>
<div><font color="#ff0000"><font color="#000000"><font color="#ff0000">struts.configuration</font></font></font></div>
<div><font color="#ff0000"><font color="#000000"><br />
&nbsp;&nbsp;&nbsp; 该属性指定加载Struts 2配置文件的配置文件管理器。该属性的默认值是org.apache.Struts2.config.DefaultConfiguration，这是Struts 2默认的配置文件管理器。如果需要实现自己的配置管理器，开发者则可以实现一个实现Configuration接口的类，该类可以自己加载Struts 2配置文件。<br />
<br />
<br />
</font></font>
<div><font color="#ff0000"><font color="#000000"><font color="#ff0000">struts.locale</font></font></font></div>
<div><font color="#ff0000"><font color="#000000"><br />
指定Web应用的默认Locale。<br />
<br />
</font></font><font color="#ff0000">struts.i18n.encoding</font></div>
<div><font color="#ff0000"><font color="#000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp; 指定Web应用的默认编码集。该属性对于处理中文请求参数非常有用，对于获取中文请求参数值，应该将该属性值设置为GBK或者GB2312。<br />
<br />
提示&nbsp; 当设置该参数为GBK时，相当于调用HttpServletRequest的setCharacterEncoding方法。<br />
<br />
<br />
</font></font></div>
<div><font color="#ff0000"><font color="#000000"><font color="#ff0000">struts.objectFactory</font></font></font></div>
<div><font color="#ff0000"><font color="#000000"><br />
&nbsp;&nbsp;&nbsp; 指定Struts 2默认的ObjectFactory Bean，该属性默认值是spring。<br />
<br />
</font></font><font color="#ff0000">struts.objectFactory.spring.autoWrite</font></div>
<div><font color="#ff0000"><font color="#000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp; 指定Spring框架的自动装配模式，该属性的默认值是name，即默认根据Bean的name属性自动装配。<br />
<br />
<font color="#ff0000">struts.objectFactory.spring.useClassCache</font></font></font></div>
<div><font color="#ff0000"><font color="#000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 该属性指定整合Spring框架时，是否缓存Bean实例，该属性只允许使用true和false两个属性值，它的默认值是true。通常不建议修改该属性值。<br />
<br />
<br />
<br />
</font></font></div>
<div><font color="#ff0000">struts.objectTypeDeterminer</font></div>
<div><font color="#ff0000"><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;该属性指定Struts 2的类型检测机制，通常支持tiger和notiger两个属性值。<br />
<br />
<br />
<font color="#ff0000"></font></font></font></div>
<div><font color="#ff0000"><font color="#000000"><font color="#ff0000">&nbsp;struts.multipart.parser</font>：该属性指定处理multipart/form-data的MIME类型（文件上传）请求的框架，该属性支持cos、pell和jakarta等属性值，即分别对应使用cos的文件上传框架、pell上传及common-fileupload文件上传框架。该属性的默认值为jakarta。<br />
<br />
注意&nbsp; 如果需要使用cos或者pell的文件上传方式，则应该将对应的JAR文件复制到Web应用中。例如，使用cos上传方式，则需要自己下载cos框架的JAR文件，并将该文件放在WEB-INF/lib路径下。<br />
<br />
</font></font><font color="#ff0000">struts.multipart.saveDir</font></div>
<div><font color="#ff0000"><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;该属性指定上传文件的临时保存路径，该属性的默认值是javax.servlet.context.tempdir。<br />
<br />
</font></font><font color="#ff0000">&nbsp;struts.multipart.maxSize</font></div>
<div><font color="#ff0000"><font color="#000000">该属性指定Struts 2文件上传中整个请求内容允许的最大字节数。<br />
<br />
</font></font><font color="#ff0000">struts.custom.properties</font></div>
<div><font color="#ff0000"><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;该属性指定Struts 2应用加载用户自定义的属性文件，该自定义属性文件指定的属性不会覆盖struts.properties文件中指定的属性。如果需要加载多个自定义属性文件，多个自定义属性文件的文件名以英文逗号（,）隔开。<br />
<br />
</font></font><font color="#ff0000">struts.mapper.class</font></div>
<div><font color="#ff0000"><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;指定将HTTP请求映射到指定Action的映射器，Struts 2提供了默认的映射器：org.apache.struts2.dispatcher.mapper.DefaultActionMapper。默认映射器根据请求的前缀与Action的name属性完成映射。<br />
<br />
</font></font><font color="#ff0000">struts.action.extension</font></div>
<div><font color="#ff0000"><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;该属性指定需要Struts 2处理的请求后缀，该属性的默认值是action，即所有匹配*.action的请求都由Struts 2处理。如果用户需要指定多个请求后缀，则多个后缀之间以英文逗号（,）隔开。<br />
<br />
</font></font><font color="#ff0000">struts.serve.static</font></div>
<div><font color="#ff0000"><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;该属性设置是否通过JAR文件提供静态内容服务，该属性只支持true和false属性值，该属性的默认属性值是true。<br />
<br />
</font></font><font color="#ff0000">struts.serve.static.browserCache</font></div>
<div><font color="#ff0000"><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;该属性设置浏览器是否缓存静态内容。当应用处于开发阶段时，我们希望每次请求都获得服务器的最新响应，则可设置该属性为false。<br />
<br />
</font></font><font color="#ff0000">&nbsp;struts.enable.DynamicMethodInvocation</font></div>
<div><font color="#ff0000"><font color="#000000">&nbsp;&nbsp;&nbsp;该属性设置Struts 2是否支持动态方法调用，该属性的默认值是true。如果需要关闭动态方法调用，则可设置该属性为false。<br />
<br />
</font></font><font color="#ff0000">struts.enable.SlashesInActionNames</font></div>
<div><font color="#ff0000"><font color="#000000">&nbsp;&nbsp;&nbsp;该属性设置Struts 2是否允许在Action名中使用斜线，该属性的默认值是false。如果开发者希望允许在Action名中使用斜线，则可设置该属性为true。<br />
<br />
</font></font><font color="#ff0000">&nbsp;struts.tag.altSyntax</font></div>
<div><font color="#ff0000"><font color="#000000">&nbsp;&nbsp;&nbsp;该属性指定是否允许在Struts 2标签中使用表达式语法，因为通常都需要在标签中使用表达式语法，故此属性应该设置为true，该属性的默认值是true。<br />
<br />
</font></font><font color="#ff0000">&nbsp;struts.devMode</font></div>
<div><font color="#ff0000"><font color="#000000">该属性设置Struts 2应用是否使用开发模式。如果设置该属性为true，则可以在应用出错时显示更多、更友好的出错提示。该属性只接受true和flase两个值，该属性的默认值是false。通常，应用在开发阶段，将该属性设置为true，当进入产品发布阶段后，则该属性设置为false。<br />
<br />
</font></font><font color="#ff0000">struts.i18n.reload</font></div>
<div><font color="#ff0000"><font color="#000000">该属性设置是否每次HTTP请求到达时，系统都重新加载资源文件。该属性默认值是false。在开发阶段将该属性设置为true会更有利于开发，但在产品发布阶段应将该属性设置为false。<br />
<br />
</font><font color="#000000"><font face="楷体_GB2312">提示&nbsp; 开发阶段将该属性设置了true，将可以在每次请求时都重新加载国际化资源文件，从而可以让开发者看到实时开发效果；产品发布阶段应该将该属性设置为false，是为了提供响应性能，每次请求都需要重新加载资源文件会大大降低应用的性能。<br />
<br />
</font></font></font><font color="#ff0000">struts.ui.theme</font></div>
<div><font color="#ff0000"><font color="#000000">该属性指定视图标签默认的视图主题，该属性的默认值是xhtml。<br />
<br />
</font></font><font color="#ff0000">struts.ui.templateDir</font></div>
<div><font color="#ff0000"><font color="#000000">该属性指定视图主题所需要模板文件的位置，该属性的默认值是template，即默认加载template路径下的模板文件。<br />
<br />
</font></font><font color="#ff0000">struts.ui.templateSuffix</font></div>
<div><font color="#ff0000"><font color="#000000">该属性指定模板文件的后缀，该属性的默认属性值是ftl。该属性还允许使用ftl、vm或jsp，分别对应FreeMarker、Velocity和JSP模板。<br />
<br />
</font></font><font color="#ff0000">struts.configuration.xml.reload</font></div>
<div><font color="#ff0000"><font color="#000000">该属性设置当struts.xml文件改变后，系统是否自动重新加载该文件。该属性的默认值是false。<br />
<br />
</font></font><font color="#ff0000">struts.velocity.configfile</font></div>
<div><font color="#ff0000"><font color="#000000">该属性指定Velocity框架所需的velocity.properties文件的位置。该属性的默认值为velocity.properties。<br />
<br />
</font></font><font color="#ff0000">&nbsp;struts.velocity.contexts</font></div>
<div><font color="#ff0000"><font color="#000000">该属性指定Velocity框架的Context位置，如果该框架有多个Context，则多个Context之间以英文逗号（,）隔开。<br />
<br />
</font></font><font color="#ff0000">struts.velocity.toolboxlocation</font></div>
<div><font color="#ff0000"><font color="#000000">该属性指定Velocity框架的toolbox的位置。<br />
<br />
</font></font><font color="#ff0000">struts.url.http.port</font></div>
<div><font color="#ff0000"><font color="#000000">该属性指定Web应用所在的监听端口。该属性通常没有太大的用户，只是当Struts 2需要生成URL时（例如Url标签），该属性才提供Web应用的默认端口。<br />
<br />
</font></font><font color="#ff0000">struts.url.https.port</font></div>
<div><font color="#ff0000"><font color="#000000">该属性类似于struts.url.http.port属性的作用，区别是该属性指定的是Web应用的加密服务端口。<br />
<br />
</font></font><font color="#ff0000">struts.url.includeParams</font></div>
<div><font color="#ff0000"><font color="#000000">该属性指定Struts 2生成URL时是否包含请求参数。该属性接受none、get和all三个属性值，分别对应于不包含、仅包含GET类型请求参数和包含全部请求参数。<br />
<br />
<br />
</font></font>
<div><font color="#ff0000">&nbsp; struts.custom.i18n.resources</font></div>
<div><font color="#ff0000"><font color="#000000">该属性指定Struts 2应用所需要的国际化资源文件，如果有多份国际化资源文件，则多个资源文件的文件名以英文逗号（,）隔开。<br />
<br />
<br />
</font></font>
<div><font color="#ff0000">struts.dispatcher.parametersWorkaround</font></div>
<div><font color="#ff0000"><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;对于某些Java EE服务器，不支持HttpServlet Request调用getParameterMap()方法，此时可以设置该属性值为true来解决该问题。该属性的默认值是false。对于WebLogic、Orion和OC4J服务器，通常应该设置该属性为true。<br />
<br />
</font></font><font color="#ff0000">&nbsp;struts.freemarker.manager.classname</font></div>
<div><font color="#ff0000"><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;该属性指定Struts 2使用的FreeMarker管理器。该属性的默认值是org.apache.struts2.views.freemarker.FreemarkerManager，这是Struts 2内建的FreeMarker管理器。<br />
<br />
</font></font><font color="#ff0000">struts.freemarker.wrapper.altMap</font></div>
<div><font color="#ff0000"><font color="#000000">该属性只支持true和false两个属性值，默认值是true。通常无需修改该属性值。<br />
<br />
</font></font><font color="#ff0000">&nbsp;struts.xslt.nocache</font></div>
<div><font color="#ff0000"><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;该属性指定XSLT Result是否使用样式表缓存。当应用处于开发阶段时，该属性通常被设置为true；当应用处于产品使用阶段时，该属性通常被设置为false。<br />
<br />
</font></font><font color="#ff0000">struts.configuration.files</font></div>
<div><font color="#ff0000"><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;该属性指定Struts 2框架默认加载的配置文件，如果需要指定默认加载多个配置文件，则多个配置文件的文件名之间以英文逗号（,）隔开。该属性的默认值为struts-default.xml,struts-plugin.xml,struts.xml，看到该属性值，读者应该明白为什么Struts 2框架默认加载struts.xml文件了。</font></font></div>
</div>
</div>
</div>
<br />
<img src ="http://www.blogjava.net/sealyu/aggbug/194233.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/sealyu/" target="_blank">seal</a> 2008-04-19 20:55 <a href="http://www.blogjava.net/sealyu/articles/194233.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>struts2.0中配置tiles[转自haoxing272专栏]</title><link>http://www.blogjava.net/sealyu/articles/194232.html</link><dc:creator>seal</dc:creator><author>seal</author><pubDate>Sat, 19 Apr 2008 12:54:00 GMT</pubDate><guid>http://www.blogjava.net/sealyu/articles/194232.html</guid><wfw:comment>http://www.blogjava.net/sealyu/comments/194232.html</wfw:comment><comments>http://www.blogjava.net/sealyu/articles/194232.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/sealyu/comments/commentRss/194232.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/sealyu/services/trackbacks/194232.html</trackback:ping><description><![CDATA[<p>1.在WEB-INF/lib下加入所需的jar包&nbsp;</p>
<p><span>&nbsp;&nbsp;&nbsp; commons-digester-1.6.jar</span>，</p>
<div><span>&nbsp;&nbsp;&nbsp; <span class="hilite2">tiles</span>-core-2.0-20070207.130156-4.jar</span>，</div>
<div><span>&nbsp;&nbsp;&nbsp; <span class="hilite2">tiles</span>-api-2.0-20070207.130156-4.jar</span>，</div>
<div><span>&nbsp;&nbsp;&nbsp; <span class="hilite1">struts2</span>-<span class="hilite2">tiles</span>-plugin-2.0.6.jar</span>，</div>
<div style="text-indent: 21pt"><span class="hilite1">struts2</span>-core-2.0.6.jar</div>
<div style="text-indent: 21pt">xwork-2.0.1.jar，</div>
<div>2. 以下内容添加到web.xml </div>
<div align="left">&nbsp;<span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">context-param</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">param-name</span><span style="font-size: 10pt; color: teal">&gt;</span><span style="font-size: 10pt; color: black">org.apache.<span class="hilite2">tiles</span>.CONTAINER_FACTORY</span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">param-name</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">param-value</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; org.apache.<span class="hilite1">struts2</span>.<span class="hilite2">tiles</span>.Struts<span class="hilite2">Tiles</span>ContainerFactory</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">param-value</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">context-param</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp; </span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">context-param</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">param-name</span><span style="font-size: 10pt; color: teal">&gt;</span><span style="font-size: 10pt; color: black">&nbsp;&nbsp; org.apache.<span class="hilite2">tiles</span>.impl.Basic<span class="hilite2">Tiles</span>Container.DEFINITIONS_CONFIG</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">param-name</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">param-value</span><span style="font-size: 10pt; color: teal">&gt;</span><span style="font-size: 10pt; color: black">/WEB-INF/<span class="hilite2">tiles</span>.xml</span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">param-value</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">context-param</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left">&nbsp;</div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">listener</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">listener-class</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; org.apache.<span class="hilite1">struts2</span>.<span class="hilite2">tiles</span>.Struts<span class="hilite2">Tiles</span>Listener</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">listener-class</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">listener</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div>3.在WEB-INF下添加和<span class="hilite2">tiles</span>.tld和<span class="hilite2">tiles</span>.xml文件，其中<span class="hilite2">tiles</span>.tld内容为<span class="hilite2">tiles</span>-core-2.0-20070207.130156-4.jar包中META_INF/<span class="hilite2">tiles</span>-core.tld的内容。</div>
<div><span class="hilite2">tiles</span>.xml内容：</div>
<div align="left"><span style="font-size: 10pt; color: teal"><!--sp--><span style="font-size: 10pt; color: rgb(63,127,127)">xml </span><span style="font-size: 10pt; color: rgb(127,0,127)">version</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"1.0" </span><span style="font-size: 10pt; color: rgb(127,0,127)">encoding</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"GB2312" </span><span style="font-size: 10pt; color: teal">?&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: teal"><!--sp--><span style="font-size: 10pt; color: rgb(63,127,127)">DOCTYPE </span><span style="font-size: 10pt; color: navy"><span class="hilite2">tiles</span>-definitions </span><span style="font-size: 10pt; color: gray">PUBLIC</span></span></div>
<div align="left"><span style="font-size: 10pt; color: gray">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: navy">"-//Apache Software Foundation//DTD <span class="hilite2">Tiles</span> Configuration 2.0//EN"</span></div>
<div align="left"><span style="font-size: 10pt; color: navy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: rgb(63,127,95)">"http://jakarta.apache.org/struts/dtds/<span class="hilite2">tiles</span>-config.dtd"</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)"><span class="hilite2">tiles</span>-definitions</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">definition </span><span style="font-size: 10pt; color: rgb(127,0,127)">name</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"myapp.homepage" </span><span style="font-size: 10pt; color: rgb(127,0,127)">template</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"layout.jsp"</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">put </span><span style="font-size: 10pt; color: rgb(127,0,127)">name</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"title" </span><span style="font-size: 10pt; color: rgb(127,0,127)">value</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"<span class="hilite2">Tiles</span> tutorial homepage" </span><span style="font-size: 10pt; color: teal">/&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">put </span><span style="font-size: 10pt; color: rgb(127,0,127)">name</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"header" </span><span style="font-size: 10pt; color: rgb(127,0,127)">value</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"/<span class="hilite2">tiles</span>/header.jsp" </span><span style="font-size: 10pt; color: teal">/&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">put </span><span style="font-size: 10pt; color: rgb(127,0,127)">name</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"menu" </span><span style="font-size: 10pt; color: rgb(127,0,127)">value</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"/<span class="hilite2">tiles</span>/menu.jsp" </span><span style="font-size: 10pt; color: teal">/&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">put </span><span style="font-size: 10pt; color: rgb(127,0,127)">name</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"body" </span><span style="font-size: 10pt; color: rgb(127,0,127)">value</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"/<span class="hilite2">tiles</span>/cBody.jsp" </span><span style="font-size: 10pt; color: teal">/&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">put </span><span style="font-size: 10pt; color: rgb(127,0,127)">name</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"footer" </span><span style="font-size: 10pt; color: rgb(127,0,127)">value</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"/<span class="hilite2">tiles</span>/footer.jsp" </span><span style="font-size: 10pt; color: teal">/&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">definition</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)"><span class="hilite2">tiles</span>-definitions</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div><span>&nbsp;&nbsp;&nbsp; </span></div>
<div>4.struts.xml 为：</div>
<div align="left"><span style="font-size: 10pt; color: teal"><!--sp--><span style="font-size: 10pt; color: rgb(63,127,127)">DOCTYPE </span><span style="font-size: 10pt; color: navy">struts </span><span style="font-size: 10pt; color: gray">PUBLIC&nbsp;&nbsp; </span></span></div>
<div align="left"><span style="font-size: 10pt; color: gray">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: navy">"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"&nbsp;&nbsp; </span></div>
<div align="left"><span style="font-size: 10pt; color: navy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: rgb(63,127,95)">"http://struts.apache.org/dtds/struts-2.0.dtd"</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">struts</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">package </span><span style="font-size: 10pt; color: rgb(127,0,127)">name</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"default" </span><span style="font-size: 10pt; color: rgb(127,0,127)">extends</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"<span class="hilite2">tiles</span>-default"</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><strong><span style="font-size: 10pt; color: red"><action class="com.action.MyAction" name="go"></action></span></strong></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: rgb(63,95,191)"><!--result name="success">/next.jsp</result--></span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">result </span><span style="font-size: 10pt; color: rgb(127,0,127)">name</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"success" </span><span style="font-size: 10pt; color: rgb(127,0,127)">type</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"<span class="hilite2">tiles</span>"</span><span style="font-size: 10pt; color: teal">&gt;</span><span style="font-size: 10pt; color: black">myapp.homepage</span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">result</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">action</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">package</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">struts</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: teal">红色部分根据自己项目定。注意</span><span style="font-size: 10pt; color: rgb(127,0,127)">extends</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"<span class="hilite2">tiles</span>-default"</span></div>
<div>5创建<span style="font-size: 10pt; color: rgb(42,0,255)">layout.jsp</span>：</div>
<div align="left"><span style="font-size: 10pt; color: rgb(191,95,63)"><!--</span><span style="font-size: 10pt; color: rgb(63,127,127)">page </span><span style="font-size: 10pt; color: rgb(127,0,127)">contentType</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"text/html; charset=UTF-8"</span></div>
<div align="left"><span style="font-size: 10pt; color: rgb(191,95,63)"><!--</span><span style="font-size: 10pt; color: rgb(63,127,127)">taglib </span><span style="font-size: 10pt; color: rgb(127,0,127)">uri</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"WEB-INF/tiles.tld " </span><span style="font-size: 10pt; color: rgb(127,0,127)">prefix</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"tiles"</span></div>
<div align="left"><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">html</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">head</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">title</span><span style="font-size: 10pt; color: teal">&gt;<span style="font-size: 10pt; color: rgb(63,127,127)">title</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">head</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">body</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">table </span><span style="font-size: 10pt; color: rgb(127,0,127)">width</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"768px" </span><span style="font-size: 10pt; color: rgb(127,0,127)">height</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"800px" </span><span style="font-size: 10pt; color: rgb(127,0,127)">border</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"2" </span><span style="font-size: 10pt; color: rgb(127,0,127)">align</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"center"</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">tr</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">td </span><span style="font-size: 10pt; color: rgb(127,0,127)">colspan</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"2" </span><span style="font-size: 10pt; color: rgb(127,0,127)">align</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"center" </span><span style="font-size: 10pt; color: rgb(127,0,127)">valign</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"top" </span><span style="font-size: 10pt; color: rgb(127,0,127)">width</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"768px" </span><span style="font-size: 10pt; color: rgb(127,0,127)">height</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"100px" </span><span style="font-size: 10pt; color: rgb(127,0,127)">bgcolor</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"#80ff80"</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)"><span class="hilite2">tiles</span>:insertAttribute </span><span style="font-size: 10pt; color: rgb(127,0,127)">name</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"header" </span><span style="font-size: 10pt; color: teal">/&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">td</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">tr</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">tr</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">td </span><span style="font-size: 10pt; color: rgb(127,0,127)">align</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"center"&nbsp;</span><span style="font-size: 10pt; color: rgb(127,0,127)">width</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"150px" </span><span style="font-size: 10pt; color: rgb(127,0,127)">height</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"800px" </span><span style="font-size: 10pt; color: rgb(127,0,127)">bgcolor</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"#00ff00"</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)"><span class="hilite2">tiles</span>:insertAttribute </span><span style="font-size: 10pt; color: rgb(127,0,127)">name</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"menu" </span><span style="font-size: 10pt; color: teal">/&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">td</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">td </span><span style="font-size: 10pt; color: rgb(127,0,127)">align</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"right"&nbsp;</span><span style="font-size: 10pt; color: rgb(127,0,127)">width</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"618px" </span><span style="font-size: 10pt; color: rgb(127,0,127)">height</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"800px" </span><span style="font-size: 10pt; color: rgb(127,0,127)">bgcolor</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"#ff80c0"</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)"><span class="hilite2">tiles</span>:insertAttribute </span><span style="font-size: 10pt; color: rgb(127,0,127)">name</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"body" </span><span style="font-size: 10pt; color: teal">/&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">td</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">tr</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">tr</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">td </span><span style="font-size: 10pt; color: rgb(127,0,127)">colspan</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"2" </span><span style="font-size: 10pt; color: rgb(127,0,127)">bgcolor</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"#00ff40" </span><span style="font-size: 10pt; color: rgb(127,0,127)">height</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"100px"</span><span style="font-size: 10pt; color: teal">&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)"><span class="hilite2">tiles</span>:insertAttribute </span><span style="font-size: 10pt; color: rgb(127,0,127)">name</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"footer" </span><span style="font-size: 10pt; color: teal">/&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">td</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">tr</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">table</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">body</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div align="left"><span style="font-size: 10pt; color: teal"><span style="font-size: 10pt; color: rgb(63,127,127)">html</span><span style="font-size: 10pt; color: teal">&gt;</span></span></div>
<div>&nbsp;</div>
<div align="left"><span style="font-size: 10pt">6.</span><span style="font-size: 10pt">根据</span></div>
<div align="left"><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">put </span><span style="font-size: 10pt; color: rgb(127,0,127)">name</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"title" </span><span style="font-size: 10pt; color: rgb(127,0,127)">value</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"<span class="hilite2">Tiles</span> tutorial homepage" </span><span style="font-size: 10pt; color: teal">/&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">put </span><span style="font-size: 10pt; color: rgb(127,0,127)">name</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"header" </span><span style="font-size: 10pt; color: rgb(127,0,127)">value</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"/<span class="hilite2">tiles</span>/header.jsp" </span><span style="font-size: 10pt; color: teal">/&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">put </span><span style="font-size: 10pt; color: rgb(127,0,127)">name</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"menu" </span><span style="font-size: 10pt; color: rgb(127,0,127)">value</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"/<span class="hilite2">tiles</span>/menu.jsp" </span><span style="font-size: 10pt; color: teal">/&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">put </span><span style="font-size: 10pt; color: rgb(127,0,127)">name</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"body" </span><span style="font-size: 10pt; color: rgb(127,0,127)">value</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"/<span class="hilite2">tiles</span>/cBody.jsp" </span><span style="font-size: 10pt; color: teal">/&gt;</span></div>
<div align="left"><span style="font-size: 10pt; color: black">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; color: teal">&lt;</span><span style="font-size: 10pt; color: rgb(63,127,127)">put </span><span style="font-size: 10pt; color: rgb(127,0,127)">name</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"footer" </span><span style="font-size: 10pt; color: rgb(127,0,127)">value</span><span style="font-size: 10pt; color: black">=</span><span style="font-size: 10pt; color: rgb(42,0,255)">"/<span class="hilite2">tiles</span>/footer.jsp" </span><span style="font-size: 10pt; color: teal">/&gt;</span></div>
<div align="left"><span style="font-size: 10pt">在</span><span style="font-size: 10pt">WebRoot</span><span style="font-size: 10pt">下创建</span><span style="font-size: 10pt"><span class="hilite2">tiles</span></span><span style="font-size: 10pt">目录和相应</span><span style="font-size: 10pt">jsp</span><span style="font-size: 10pt">文件</span></div>
<div align="left"><span style="font-size: 10pt">7.</span><span style="font-size: 10pt">下载源代码</span><span style="font-size: 10pt">资源<a href="http://download.csdn.net/user/haoxing272">http://download.csdn.net/user/haoxing272</a></span><span style="font-size: 10pt">。</span></div>
<img src ="http://www.blogjava.net/sealyu/aggbug/194232.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/sealyu/" target="_blank">seal</a> 2008-04-19 20:54 <a href="http://www.blogjava.net/sealyu/articles/194232.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>