﻿<?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-选择java 进入自由开放的国度-随笔分类-Struts</title><link>http://www.blogjava.net/soochow_hhb/category/1422.html</link><description>&lt;style&gt;
#glowtext{
filter:glow(color=green,strength=2);width:100%;
}
&lt;/style&gt;
&lt;span id="glowtext"&gt;
&lt;script language="JavaScript1.2"&gt;
var message=" 具有丰富知识和经验的人，比只有一种知识和经验的人更容易产生新的联想和独到的见解。"
var neonbasecolor="#FF930D"
var neontextcolor="#00B3FD"
var flashspeed=300  //in milliseconds

var n=0
if (document.all){
document.write('&lt;font color="'+neonbasecolor+'"&gt;')
for (m=0;m&lt;message.length;m++)
document.write('&lt;span id="neonlight" class="content"&gt;'+message.charAt(m)+'&lt;/span&gt;')
document.write('&lt;/font&gt;')

//cache reference to neonlight array
var tempref=document.all.neonlight
}
else
document.write(message)

function neon(){

//Change all letters to base color
if (n==0){
for (m=0;m&lt;message.length;m++)
tempref[m].style.color=neonbasecolor
}

//cycle through and change individual letters to neon color
tempref[n].style.color=neontextcolor

if (n&lt;tempref.length-1)
n++
else{
n=0
clearInterval(flashing)
setTimeout("beginneon()",1500)
return
}
}

function beginneon(){
if (document.all)
flashing=setInterval("neon()",flashspeed)
}
beginneon()

&lt;/script&gt;
&lt;/span&gt;</description><language>zh-cn</language><lastBuildDate>Tue, 27 Feb 2007 11:05:55 GMT</lastBuildDate><pubDate>Tue, 27 Feb 2007 11:05:55 GMT</pubDate><ttl>60</ttl><item><title>jsp-java-mysql字符集统一</title><link>http://www.blogjava.net/soochow_hhb/archive/2006/11/03/78845.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Fri, 03 Nov 2006 01:03:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2006/11/03/78845.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/78845.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2006/11/03/78845.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/78845.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/78845.html</trackback:ping><description><![CDATA[1、在jsp中，字符集由&lt;%@ page language="java" contentType="text/html;charset=GBK"%&gt;来指定，如果处理中文，需指定为gbk。所以提交的数据全部都使用gbk编码；<br />2、在java中，从jsp提交过来的数据是gbk编码的，而java默认的处理方式是使用ISO-8859-1编码，所以若在java中能显示jsp提交过来的gbk编码方式的数据，就要进行一个转换：将gbk转换为ISO-8859-1，这样数据就可正常显示。<br />3、如果要将jsp提交的数据经过java后台处理，然后放入数据库中，就又多了一个数据编码方式：数据库的数据编码方式。以mysql为例，默认字符集为latin，所以若将gbk的数据放入，必然出现乱码，所以首先应改变数据库的编码方式为gbk。<br /><br />综上，简单的设置方法如下：<br /><br />jsp (gbk)     ----&gt;     java(ISO-8859-1)  -------&gt; mysql(gbk)<br />                                                                转换<br />这样设置之后，还有一种情况会出现乱码：当你在jsp端提交一个id号，然后在java处理端通过id号得到数据库中的gbk（汉字）数据，这是就会出现乱码，因为java处理的是ISO-8859-1，你在java到mysql中有了一个ISO-8859-1到gbk的转换，而这些数据本身就是ISO-8859-1,所以转换后就出现问题了。<br />解决办法：将在java中处理的gbk数据转换为ISO-8859-1即可。<br /><br />总之：在jsp，java，mysql三者之间的编码方式必须统一，不能错误的转换或者不转换。<img src ="http://www.blogjava.net/soochow_hhb/aggbug/78845.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2006-11-03 09:03 <a href="http://www.blogjava.net/soochow_hhb/archive/2006/11/03/78845.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>IoC的初步理解</title><link>http://www.blogjava.net/soochow_hhb/archive/2006/09/30/72966.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Sat, 30 Sep 2006 02:37:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2006/09/30/72966.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/72966.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2006/09/30/72966.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/72966.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/72966.html</trackback:ping><description><![CDATA[
		<p>好久写有关java技术的文章了，这几天在图书馆看到《Spring in Action》就借过来随手翻翻，觉得第一章的IoC的概念讲的很好，现在整理如下。<br /><font style="BACKGROUND-COLOR: #ffffff" color="#a52a2a"><strong>（1）从类的耦合说起<br /></strong></font>在实际的系统中，要多个类共同协作来完成某一项任务，一般称为复合。在系统的设计过程中，耦合是不可避免的，是必须的，但是它会带来以下问题：<br />－－难以测试：看下面的两个类：<br />KnightOfTheRoundTable<br />                  |<br />                  |  new<br />                 V<br />         HolyGrailQuest<br />在KnightOfTheRoundTable类中使用了HolyGrailQuest类，并且可能使用不同的Quest类。这两个类的功能是骑士去执行不同的任务，HolyGrail只是代表了一种任务。这种通过国new的方式，使得knight和quest两个类紧密的耦合在一起。设计完成后做单元测试，看下面的代码：<br />KnightOfTheRoundTable knight = new KnightOfTheRoundTable("Bedivere");<br />HolyGrail grail = knight.embarkOnQuery();<br />assertNotNull(grail);<br />assertTrue(grail.isHoly());<br />在测试KnightOfTheRoundTable类的时候，间接的测试了HolyGrailQuest类，但是对于HolyGrailQuest类的情况并没有很显式的测试，所以使用了最后的两行代码来测试，显得很笨拙。不知道是否测试了所有可能的情况。<br />－－难以维护<br />如果以后修改了代码，或者增加了/改变了knight的任务，代码必须改动，测试代码也要改动，并且改动一个地方，可能会影响到其他很多地方，为日后的维护工作带来了麻烦<br />－－紧耦合<br />提示：这种模式引起的问题，主要是因为紧耦合所致，所以要解决这种问题的首要方案就是解耦合，但如何来解耦合呢？请继续看：<br /><font color="#a52a2a"><strong>（2）解耦合——通过接口interface来实现<br /></strong></font>因为骑士可能执行不同的任务，也有不同种类的骑士，所以我们可以将任务和骑士抽象为接口，将具体的实现隐藏在接口之下，这样就不必在knight类中通过显示的 HolyGrailQuest quest = new HolyGrailQuest ()这样的语句来创建Quest对象，而可以通过接口Quest quest ＝ new HolyGrailQuest()来实现。这样就形成了如下的类图：<br /><span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"><img src="http://www.blogjava.net/images/blogjava_net/soochow_hhb/1228/r_.bmp" /></span></p>
		<p>
				<span lang="EN-US" style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">这样，虽然使用了接口，使得层次分明，通过接口Quest来实现探险，但是还是只能从事一种探险任务，而如何才能让骑士从事任何一种任务呢？请继续看！<br /><font color="#a52a2a"><strong>（3）给予与获得</strong></font><br />骑士执行探险任务有两种方式：<br />第一、让骑士主动获得探险任务，前面的实现方式属于这类，通过new来实现；<br />第二，让骑士被动的获得任务，即给予骑士某项探险任务，这样就解决了上面的问题（让骑士可以从事任何一种任务，只要给他们分配即可）。<br />实际实现的方式很简单，看如下代码：<br />public void setQuest(Quest quest){<br />   this.quest = quest;<br />}<br /><font color="#0000ff"><strong>简单的代码实现了方式的改变，这样给KnightOfTheRoundTable类传入任何的Quest任务，都可以接受了。<br />到这里可以很明显的看出来，我们将以前的new方式，翻转过来，即不是让主动获得依赖类，而是被动的获得依赖类，这就是IoC的核心，实际Fowler说得依赖注入也很贴切，即向类中“注入”它依赖的其他类。<br /></strong></font><br />好了，到这里，应该知道了IoC的基本概念了吧，也知道了IoC的基本功能了吧。<br />要想更深入的了解，请关注我的文章。</span>
		</p>
<img src ="http://www.blogjava.net/soochow_hhb/aggbug/72966.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2006-09-30 10:37 <a href="http://www.blogjava.net/soochow_hhb/archive/2006/09/30/72966.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>软件新技术课的作业 </title><link>http://www.blogjava.net/soochow_hhb/archive/2005/06/13/6051.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Mon, 13 Jun 2005 08:23:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2005/06/13/6051.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/6051.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2005/06/13/6051.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/6051.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/6051.html</trackback:ping><description><![CDATA[关于Struts和webwork的比较，还有单元测试Junit和容器测试Cactus的一些情况！pdf格式，欢迎探讨相关技术，本来还想写数据持久化的一些内容，如JDO和Hibernate，因为时间关系，没有来得及写入，希望以后能够补上！<BR><BR>欢迎交流！<A href="http://www.blogjava.net/Files/soochow_hhb/从开源项目看软件技术.rar">下载</A><img src ="http://www.blogjava.net/soochow_hhb/aggbug/6051.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2005-06-13 16:23 <a href="http://www.blogjava.net/soochow_hhb/archive/2005/06/13/6051.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用Tiles和Struts设计web界面</title><link>http://www.blogjava.net/soochow_hhb/archive/2005/06/13/5627.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Mon, 13 Jun 2005 08:11:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2005/06/13/5627.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/5627.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2005/06/13/5627.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/5627.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/5627.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 进行Web开发，很重要的一点就是界面的组合，如何能够高效的实现页面的重用，本文给出了使用Tiles和Struts集成的方式来实现最大程度的界面重用，只要使用tiles的xml配置文件就可以将web页面设计师的杰作组合起来，并且可以使用Struts的控制器来引用，实现了页面和逻辑的分离！&nbsp;&nbsp;<a href='http://www.blogjava.net/soochow_hhb/archive/2005/06/13/5627.html'>阅读全文</a><img src ="http://www.blogjava.net/soochow_hhb/aggbug/5627.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2005-06-13 16:11 <a href="http://www.blogjava.net/soochow_hhb/archive/2005/06/13/5627.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Strus常见错误及原因分析</title><link>http://www.blogjava.net/soochow_hhb/archive/2005/06/11/5905.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Sat, 11 Jun 2005 03:58:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2005/06/11/5905.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/5905.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2005/06/11/5905.html#Feedback</comments><slash:comments>16</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/5905.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/5905.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 本篇文章包含了在用Struts开发web应用时经常碰到的一些异常和错误，根据异常或错误信息本身，经常可以找到潜在的错误发生原因。下面列出了一些Struts的常见错误和异常，并给出了一些可能发生此类错误或异常的原因。有的后面有相关连接，你可以通过它找到更多的信息。Cannot retrieve mapping for action 异常 javax.s...&nbsp;&nbsp;<a href='http://www.blogjava.net/soochow_hhb/archive/2005/06/11/5905.html'>阅读全文</a><img src ="http://www.blogjava.net/soochow_hhb/aggbug/5905.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2005-06-11 11:58 <a href="http://www.blogjava.net/soochow_hhb/archive/2005/06/11/5905.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Struts vs webwork 中文</title><link>http://www.blogjava.net/soochow_hhb/archive/2005/05/29/5311.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Sun, 29 May 2005 06:16:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2005/05/29/5311.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/5311.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2005/05/29/5311.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/5311.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/5311.html</trackback:ping><description><![CDATA[这是前一篇文章的译文，来自<SPAN lang=EN-US style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">moxie的《WebWork教程－0.90版》<BR></SPAN>欢迎一起探讨WEB Framework。<A href="http://www.blogjava.net/soochow_hhb/">http://www.blogjava.net/soochow_hhb/</A>&nbsp;<BR>
<TABLE style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt" cellSpacing=0 cellPadding=0 border=1>
<TBODY>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 50.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" vAlign=top width=67>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">特</SPAN> </B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">征</SPAN><SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></B></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 171pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=228>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" align=center><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US>Struts1.1<o:p></o:p></SPAN></B></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 204.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=273>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" align=center><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US>WebWork2<o:p></o:p></SPAN></B></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 50.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=67>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 171pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=228>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US>Struts</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">里面，每一个</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类必需要继承一个抽象的类</SPAN><SPAN lang=EN-US>org.apache.struts.action.Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。这个在</SPAN><SPAN lang=EN-US>Java</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">编程中会引来一些问题，就是关于多种继承的问题。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 204.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=273>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>WebWork</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类仅需要实现接口</SPAN><SPAN lang=EN-US>com.opensymphony.xwork.Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，也可以实现其它的接口来实现更多的功能，譬如：</SPAN><SPAN lang=EN-US>validate</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（验证），</SPAN><SPAN lang=EN-US>localware(</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">国际化</SPAN><SPAN lang=EN-US>)</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">等。当然，它也提供了一个类</SPAN><SPAN lang=EN-US>ActionSupport</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">集成了上面的所有功能，我们在开发中可以根据需要选择。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 50.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=67>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">线程模型</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 171pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=228>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Struts </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">必需是</SPAN><SPAN lang=EN-US>thread</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">－</SPAN><SPAN lang=EN-US>safe</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方式，它仅仅允许一个实例去处理所有的请求。所以</SPAN><SPAN lang=EN-US>action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">用到的所有的资源都必需统一同步，这个就引起了线程安全的问题。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 204.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=273>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US>WebWork</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中，每个请求对应一个</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，因此没有线程的安全问题。实际上</SPAN><SPAN lang=EN-US>Servlet</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">容器对每个请求也产生多个对象，它也没有证明对性能和垃圾回收产生太多的影响。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 50.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=67>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Servlet</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的依赖</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 171pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=228>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Struts</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处理</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">时必需要依赖</SPAN><SPAN lang=EN-US>ServletRequest </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>ServletResponse</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，所有它摆脱不了</SPAN><SPAN lang=EN-US>Servlet</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">容器。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 204.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=273>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>WebWork</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">不用依赖</SPAN><SPAN lang=EN-US>Web</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">层和其它的容器。它可以通过</SPAN><SPAN lang=EN-US>ActionContext</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，直接去访问</SPAN><SPAN lang=EN-US>Request</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>Response</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，但这个是可选的，只有在必需的请求下使用。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 50.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=67>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">测试</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 171pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=228>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Struts</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的每个</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">都同</SPAN><SPAN lang=EN-US>Web</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">层耦合在一起，这样它的测试依赖于</SPAN><SPAN lang=EN-US>Web</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">容器，单元测试也很难实现。不过有一个</SPAN><SPAN lang=EN-US>Junit</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的扩展工具</SPAN><SPAN lang=EN-US>Struts TestCase</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以实现它的单元测试。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 204.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=273>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Webwork</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">能够通过赋予一定的属性，就可以执行单元测试。同时也可以使用一个</SPAN><SPAN lang=EN-US>mock</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的实例去测试，而不是通过启动</SPAN><SPAN lang=EN-US>web</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">容器来进行测试。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 50.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=67>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>FormBean<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 171pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=228>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Struts</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">要求有</SPAN><SPAN lang=EN-US>FormBean</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对应每一个表单，而且</SPAN><SPAN lang=EN-US>FormBean</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">必需继承抽象类</SPAN><SPAN lang=EN-US>ActionForm</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。而使用</SPAN><SPAN lang=EN-US>DynaBeans</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实际上没有太大的意义。不能够很好的处理现有的模型。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 204.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=273>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Webwork </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">能够动态的收集</SPAN><SPAN lang=EN-US>web</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的数据然后再赋值给</SPAN><SPAN lang=EN-US>bean</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。它也可以使用</SPAN><SPAN lang=EN-US>FormBean</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的形式，</SPAN><SPAN lang=EN-US>FormBean</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以是普通的</SPAN><SPAN lang=EN-US>DTO</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和域对象，它不用重新根据域对象来生成新的</SPAN><SPAN lang=EN-US>FormBean</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，也不需继承抽象类</SPAN><SPAN lang=EN-US>ActionForm</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 50.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=67>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">前端表达式语言</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 171pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=228>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Struts</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">集成了</SPAN><SPAN lang=EN-US>JSTL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，所以它主要使用</SPAN><SPAN lang=EN-US>JSTL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的表达式语言来获取数据。可是</SPAN><SPAN lang=EN-US>JSTL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的表达式语言在</SPAN><SPAN lang=EN-US>Collection</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和索引属性方面处理显得很弱。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 204.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=273>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>WebWork</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的表达式语言使用了功能强大的</SPAN><SPAN lang=EN-US>OGNL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。它使用</SPAN><SPAN lang=EN-US>OGNL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">建立一个</SPAN><SPAN lang=EN-US>OgnlValueStack</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来搜索数据。</SPAN><SPAN lang=EN-US>Webwork</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">前端也可以使用</SPAN><SPAN lang=EN-US>JSTL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，但它同时支持：</SPAN><SPAN lang=EN-US>velocity</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>freemaker</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>jspparer</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>xml</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 50.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=67>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类型的转换</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 171pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=228>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Struts</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>FormBean</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">把所有的数据都作为</SPAN><SPAN lang=EN-US>String</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类型，它可以使用工具</SPAN><SPAN lang=EN-US>Commons-Beanutils</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">进行类型转化。但它的转化都是在</SPAN><SPAN lang=EN-US>Class</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">级别，而且转化的类型是不可配置的。类型转化时的错误信息返回给用户也是非常困难的。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 204.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=273>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>WebWork</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使用</SPAN><SPAN lang=EN-US>OGNL</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">进行类型转化，提供了所有基本类型的转化功能。类型转化可以直接对一个</SPAN><SPAN lang=EN-US>Class</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">进行（</SPAN><SPAN lang=EN-US>Class</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">级别）转化，也可以对</SPAN><SPAN lang=EN-US>Class</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的字段进行类型转化。它使用拦截器可以很容易的将类型转化的错误信息返回给用户，而且错误信息可以对应到一个相应的字段。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 50.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=67>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对</SPAN><SPAN lang=EN-US>Action </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">执行前和后的处理</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 171pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=228>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Struts</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处理</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的时候是基于</SPAN><SPAN lang=EN-US>class</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>hierarchies</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，很难在</SPAN><SPAN lang=EN-US>action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处理前和后进行操作。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 204.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=273>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Webwork2 </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">允许您处理</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以通过拦截器，就是在每一个</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处理前或者后进行其它操作。它的拦截器可以在配置文件中动态添加，这样</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和拦截器之间完全解藕，更好的实现了组件化。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 50.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=67>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">验证处理</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 171pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=228>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Struts</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的验证是调用</SPAN><SPAN lang=EN-US>FormBean</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>validator()</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方法，其实就是对</SPAN><SPAN lang=EN-US>FormBean</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的验证。它一般使用框架</SPAN><SPAN lang=EN-US>Commons Validation</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">进行数据验证处理。它使用了一个全局的配置文件</SPAN><SPAN lang=EN-US>validation.xml</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">定义了</SPAN><SPAN lang=EN-US>FormBean</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的验证信息。</SPAN><SPAN lang=EN-US>Struts</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>FormBean</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性都被认为是</SPAN><SPAN lang=EN-US>String</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类型，所以它在验证时也需要额外的类型转化。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 204.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=273>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>WebWork</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使用</SPAN><SPAN lang=EN-US>Xwork</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的验证框架进行验证处理，它可以通过配置拦截器来激活。它可以为每个需要验证的</SPAN><SPAN lang=EN-US>Class</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定一个</SPAN><SPAN lang=EN-US>xml</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">验证文件，也可以为一个</SPAN><SPAN lang=EN-US>Class</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在不同的情况指定不同的</SPAN><SPAN lang=EN-US>xml</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">验证文件。</SPAN><SPAN lang=EN-US>WebWork</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">证可以给每个</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类指定对应的验证文件，也可以给</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的字段去指定验证文件。通过拦截器来组装</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和其验证文件，使它们之间完全解藕。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 50.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=67>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">执行的控制</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 171pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=228>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>Struts</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">创建一个</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，如果想控制它的执行顺序将会非常困难。甚至你要重新去写</SPAN><SPAN lang=EN-US>Servlet</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来实现你的这个功能需求。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 204.7pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=273>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在这个方面，</SPAN><SPAN lang=EN-US>WebWork</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的拦截器栈提供了强大的功能。</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的所有切面功能都有拦截器来实现（比如：取得</SPAN><SPAN lang=EN-US>request</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">请求参数、验证处理等），这样你就可以用拦截器栈来组织拦截器的执行顺序。例如：你需要在使用</SPAN><SPAN lang=EN-US>request</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">请求参数来设置</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">属性之前，使用</SPAN><SPAN lang=EN-US>IoC</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">框架设置</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的属性，反之已然。这时，你就可以为</SPAN><SPAN lang=EN-US>package</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">或</SPAN><SPAN lang=EN-US>Action</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定一个拦截器栈来实现。</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></P></TD></TR></TBODY></TABLE><img src ="http://www.blogjava.net/soochow_hhb/aggbug/5311.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2005-05-29 14:16 <a href="http://www.blogjava.net/soochow_hhb/archive/2005/05/29/5311.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Sturts vs WebWork</title><link>http://www.blogjava.net/soochow_hhb/archive/2005/05/27/5267.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Fri, 27 May 2005 06:38:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2005/05/27/5267.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/5267.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2005/05/27/5267.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/5267.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/5267.html</trackback:ping><description><![CDATA[来自官方<A href="http://www.opensymphony.com/webwork/wikidocs/Comparison%20to%20Struts.html">http://www.opensymphony.com/webwork/wikidocs/Comparison%20to%20Struts.html</A>网站对Struts和WebWork的比较。<BR><BR>
<TABLE style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; MARGIN-LEFT: 3.75pt; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 0cm 0cm 0cm" cellSpacing=0 cellPadding=0 border=1>
<TBODY>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 0cm; BACKGROUND: #e0e0e0; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm; TEXT-ALIGN: center" align=center><B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Feature<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></B></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 0cm; BACKGROUND: #e0e0e0; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; mso-border-left-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm; TEXT-ALIGN: center" align=center><B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Struts<o:p></o:p></SPAN></B></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 0cm; BACKGROUND: #e0e0e0; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; mso-border-left-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm; TEXT-ALIGN: center" align=center><B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">WebWork 1.x<o:p></o:p></SPAN></B></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 0cm; BACKGROUND: #e0e0e0; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; mso-border-left-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm; TEXT-ALIGN: center" align=center><B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">WebWork 2.x<o:p></o:p></SPAN></B></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Action classes</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Struts requires Action classes to extend an Abstract base class. This shows a common problem in Struts of programming to abstract classes instead of interfaces.<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Action classes must implement the webwork.Action Interface. There are other Interfaces which can be implemented for other services, such as storing error messages, getting localized texts, etc. The ActionSupport class implements many of these Interfaces and can act as a base class. WebWork is all written to Interfaces, which allows for plugging in your own implementations.<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">An Action must implement the com.opensymphony.xwork.Action Interface, with a series of other Interfaces for other services, like in WebWork 1.x. WebWork2 has its own ActionSupport to implement these Interfaces.<o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Threading Model</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Struts Actions must be thread-safe because there will only be one instance to handle all requests. This places restrictions on what can be done with Struts Actions as any resources held must be thread-safe or access to them must be synchronized.<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">WebWork Actions are instantiated for each request, so there are no thread-safety issues. In practice, Servlet containers generate many throw-away objects per request, and one more Object does not prove to be a problem for performance or garbage collection.<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">ditto<o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Servlet Dependency</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Struts Actions have dependencies on Servlets because they get the ServletRequest and ServletResponse (not HttpServletRequest and HttpServletResponse, I've been told) when they are executed. This tie to Servlets (although not Http*) is a defacto tie to a Servlet container, which is an unneeded dependency. Servlets may be used outside a Web context, but it's not a good fit for JMS, for instance.<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">WebWork Actions are not tied to the web or any container. WebWork actions CAN choose to access the request and response from the ActionContext, but it is not required and should be done only when ABSOLUTELY neccessary to avoid tieing code to the Web.<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">ditto<o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Testability</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Many strategies have sprung up around testing Struts applications, but the major hurdle is the fact that Struts Actions are so tightly tied to the web (receiving a Request and Response object). This often leads people to test Struts Actions inside a container, which is both slow and NOT UNIT TESTING. There is a Junit extension : Struts TestCase (<A title="Visit page outside Confluence" href="http://strutstestcase.sourceforge.net/"><FONT color=#003366>http://strutstestcase.sourceforge.net/</FONT></A>)<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">WebWork actions can be tested by instantiating your action, setting the properties, and executing them<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">ditto, but the emphasis on Inversion of Control makes testing even simpler, as you can just set a Mock implementation of your services into your Action for testing, instead of having to set up service registries or static singletons<o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">FormBeans</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Struts requires the use of FormBeans for every form, necessitating either a lot of extra classes or the use of DynaBeans, which are really just a workaround for the limitation of requiring FormBeans<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">WebWork 1.x allows you to have all of your properties directly accessible on your Action as regular Javabeans properties, including rich Object types which can have their own properties which can be accessed from the web page. WebWork also allows the FormBean pattern, as discussed in "<A title="Populate Form Bean and access its value" href="http://wiki.opensymphony.com//display/WW1/Populate+Form+Bean+and+access+its+value"><FONT color=#003366>WW1:Populate Form Bean and access its value</FONT></A>"<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">WebWork 2 allows the same features as WebWork 1, but adds ModelDriven Actions, which allow you to have a rich Object type or domain object as your form bean, with its properties directly accessible to the web page, rather than accessing them as sub-properties of a property of the Action.<o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Expression Language</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Struts 1.1 integrates with JSTL, so it uses the JSTL EL. This EL has basic object graph traversal, but relatively weak collection and indexed property support.<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">WebWork 1.x has its own Expression language which is built for accessing the ValueStack. Collection and indexed property support are basic but good. WebWork can also be made to work directly with JSTL using the Filter described in <A title="Using JSTL seamlessly with WebWork" href="http://wiki.opensymphony.com//display/WW1/Using+JSTL+seamlessly+with+WebWork"><FONT color=#003366>WW1:Using JSTL seamlessly with WebWork</FONT></A><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">WebWork 2 uses <A title=Ognl href="http://wiki.opensymphony.com//display/XW/Ognl"><FONT color=#003366>XW:Ognl</FONT></A> which is a VERY powerful expression language, with additions for accessing the value stack. Ognl supports very powerful collection and indexed property support. Ognl also supports powerful features like projections (calling the same method on each member of a collection and building a new collection of the results), selections (filtering a collection with a selector expression to return a subset), list construction, and lambda expressions (simple functions which can be reused). Ognl also allows access to static methods, static fields, and constructors of classes. WebWork2 may also use JSTL as mentioned in <A title="Using JSTL seamlessly with WebWork" href="http://wiki.opensymphony.com//display/WW1/Using+JSTL+seamlessly+with+WebWork"><FONT color=#003366>WW1:Using JSTL seamlessly with WebWork</FONT></A><o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Binding values into views</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Struts uses the standard JSP mechanism for binding objects into the page context for access, which tightly couples your view to the form beans being rendered<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">WebWork sets up a ValueStack which the WebWork taglibs access to dynamically find values very flexibly without tightly coupling your view to the types it is rendering. This allows you to reuse views across a range of types which have the same properties.<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">ditto<o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Type Conversion</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Struts FormBeans properties are usually all Strings. Struts uses Commons-Beanutils for type conversion. Converters are per-class, and not configurable per instance. Getting a meaningful type conversion error out and displaying it to the user can be difficult.<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">WebWork 1.x uses PropertyEditors for type conversion. PropertyEditors are per type and not settable per Action, but field error messages are added to the field error map in the Action to be automatically displayed to the user with the field.<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">WebWork2 uses Ognl for type conversion with added converters provided for all basic types. Type converters default to these converters, but type conversion can be specified per field per class. Type conversion errors also have a default error message but can be set per field per class using the localization mechanism in WW2 and will be set into the field error messages of the Action.<o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Modular Before &amp; After Processing</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Class hierarchies of base Actions must be built up to do processing before and after delegating to the Action classes, which can lead deep class hierarchies and limitations due to the inability to have multiple inheritance <EM><A title="1 on Comparison to Struts" href="http://www.opensymphony.com/webwork/wikidocs/#ComparisontoStruts-1"><FONT color=#003366>WW:Comparison to Struts#1</FONT></A></EM><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Class hierarchies<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">WebWork 2 allows you to modularize before and after processing in Interceptors. Interceptors can be applied dynamically via the configuration without any coupling between the Action classes and the Interceptors.<o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Validation</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Struts calls validate() on the FormBean. Struts users often use Commons Validation for validation. I don't know a lot about this, so I'll put some questions here: <BR clear=all>&nbsp;<BR clear=all>Because FormBean properties are usually Strings, some types of validations must either be duplicated (checking type conversion) or cannot be done? <BR clear=all>&nbsp;<BR clear=all>Can Commons Validation have different validation contexts for the same class? (I've been told yes, so that's a good thing) <BR clear=all>&nbsp;<BR clear=all>Can Commons Validation chain to validations on sub-objects, using the validations defined for that object properties class?<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">WebWork1.x calls the validate() method on Actions, which can either do programmatic validations or call an outside validation framework (this is apparently the same as Struts)<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">WebWork2 can use the validate() method of WebWork and Struts and / or use the <A title="Validation Framework" href="http://wiki.opensymphony.com//display/XW/Validation+Framework"><FONT color=#003366>XW:Validation Framework</FONT></A>, which is activated using an XWork Interceptor. The Xwork Validation Framework allows you to define validations in an XML format with default validations for a class and custom validations added for different validation contexts. The Xwork Validation Framework is enabled via an Interceptor and is therefore completely decoupled from your Action class. The Xwork Validation Framework also allows you to chain the validation process down into sub-properties using the VisitorFieldValidator which will use the validations defined for the properties class type and the validation context.<o:p></o:p></SPAN></P></TD></TR>
<TR>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">Control Of Action Execution</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana"><o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">As far as I know Struts sets up the Action object for you, and you have very little control over the order of operations. To change them I think <?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype><v:shape id=_x0000_i1025 style="WIDTH: 12pt; HEIGHT: 12pt" alt="" type="#_x0000_t75"><v:imagedata o:href="http://www.opensymphony.com/webwork/wikidocs/icons/emoticons/help_16.gif" src="file:///D:/DOCUME~1/han/LOCALS~1/Temp/msoclip1/01/clip_image001.gif"></v:imagedata></v:shape>you need to write your own Servlet to handle dispatching as you want<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">The ActionFactory chain controls the order in which an Action is constructed and initialised, but this requires writing a class<o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: #ece9d8; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt">
<P class=MsoNormal style="MARGIN: 3.75pt 0cm"><SPAN lang=EN-US style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: Verdana">The interceptor stacks in WebWork 2 are hugely powerful in this regard. All aspects of Action setup have been moved into Interceptor implementations (ie setting paramters from the web, validation etc), so you can control on a per action basis the order in which they are performed. For example you might want your IOC framework to setup the action before the parameters are set from the request or vice versa - you can thusly control this on a per package or per action basis with interceptor stacks.<o:p></o:p></SPAN></P></TD></TR></TBODY></TABLE><img src ="http://www.blogjava.net/soochow_hhb/aggbug/5267.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2005-05-27 14:38 <a href="http://www.blogjava.net/soochow_hhb/archive/2005/05/27/5267.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>目前流行Web Framework比较和思考</title><link>http://www.blogjava.net/soochow_hhb/archive/2005/05/27/5257.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Fri, 27 May 2005 03:18:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2005/05/27/5257.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/5257.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2005/05/27/5257.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/5257.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/5257.html</trackback:ping><description><![CDATA[<P align=left>从国外网站上看到一篇文章，转发过来，附简单注解。原文在<A href="http://raibledesigns.com/page/rd/sunsets?catname=%2FJava">http://raibledesigns.com/page/rd/sunsets?catname=%2FJava</A>&nbsp;<BR>I updated my Web Framework Comparison presentation today. Rather than updating the graph that shows today's job availability, I did one that compares today to 6 months ago. Struts is still the clear winner (and growing). Spring is definitely growing. Tapestry has about the same amount of jobs (9 vs. 8). WebWork lost 10 opening (down to 4) and the demand for JSF skills has grown as well.<BR><BR><FONT style="BACKGROUND-COLOR: #ffa500"><FONT style="BACKGROUND-COLOR: #ffffff" color=#0000ff>Struts明显是最大的赢家，并且持续增长，Spring明显的有所增长，Tspestry基本持平，WebWorks下降到4，JSF的需求有所增长。</FONT></FONT><BR minmax_bound="true"><BR minmax_bound="true">Is WebWork a dying framework? I've heard folks complain about its small community, and there <EM minmax_bound="true">still</EM> <SPAN style="TEXT-DECORATION: line-through" minmax_bound="true">aren't any books</SPAN> is only <A href="http://www.amazon.com/exec/obidos/tg/detail/-/0471463620/" minmax_bound="true"><STRONG><FONT color=#cc3300>one book</FONT></STRONG></A> about it. <EM minmax_bound="true">Is that a jab at Patrick, Jason and Kris - or a jab at Manning? I'm not sure.</EM> <IMG class=smiley title=;-) alt=;-) src="http://raibledesigns.com/images/smileys/wink.gif" minmax_bound="true"> The good news is <A href="http://manning.com/lightbody" minmax_bound="true"><STRONG><FONT color=#cc3300>WebWork in Action</FONT></STRONG></A> and <A href="http://www.sourcebeat.com/TitleAction.do?id=6" minmax_bound="true"><STRONG><FONT color=#cc3300>WebWork Live</FONT></STRONG></A> should both be out this summer.<BR><BR><BR></P>
<P align=center><IMG height=394 alt=o_webframeworkjobs-May2005.gif src="http://www.blogjava.net/images/blogjava_net/soochow_hhb/1228/o_webframeworkjobs-May2005.gif" width=572 border=0></P>
<P align=left><BR></P>
<P minmax_bound="true">My search criteria for all of these was "<EM minmax_bound="true">framework</EM> and java" from the front page on <A href="http://dice.com/" minmax_bound="true"><STRONG><FONT color=#cc3300>dice.com</FONT></STRONG></A>. I did filter a bunch out for WebWork b/c there's some product called "WebWorks" that folks want to hire for. <BR minmax_bound="true"><BR minmax_bound="true">In my own experience, these numbers are not as accurate as you might think. Since I gave my original presentation, I've been contacted a number of times to work on projects. It's about even between Struts, Spring MVC, WebWork and JSF. I haven't had a single inquiry to do Tapestry development. The bad part about Struts jobs is there's so many of them, that rates are likely pretty low (i.e. 35-45/hour), whereas the others can get you upwards of 80-90/hour. <BR><FONT style="BACKGROUND-COLOR: #ffa500" color=#0000ff><FONT style="BACKGROUND-COLOR: #ffffff">依我个人的经验，这些数字不一定就很准确。 自从我发表第一篇介绍以来，我已经在项目中使用了好多次，包括Struts, Spring MVC， WebWorks 和JSF， 我还没有做Tapestry开发。 Struts不好的方面就是太多了，其工资可能稍微低一点（35/45/hour) ,而用其他框架能使你提高到80-90/hour。</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<STRONG> <BR></STRONG></FONT><BR>So what do these numbers mean? Do they mean you should tailor your learnings and skills to the most popular frameworks? In a sense, it's important to do so. If nothing else, Struts skills are import so you can migrate all the Struts applications to your favorite framework. However, I don't think these numbers are that important when choosing a framework to start your project with. I think the most important thing in choosing a framework is <EM minmax_bound="true">passion</EM>. Which one do you want to work with the most? It's likely that your productivity will be higher if you're enthusiastic about the framework, rather than bored with all the skills you've accumulated using it. Then again, if you're motivated by productivity more than enthusiasm - using your skills to crank out applications quickly is probably a good idea. <BR><FONT color=#0000ff><FONT style="BACKGROUND-COLOR: #ffa500"><FONT style="BACKGROUND-COLOR: #ffffff">那么这些数字意味着我们应该做什么呢？是不是意味着应该学习那些最流行的框架？乍眼看来，这样做是很重要的。 如果没有别的，Struts是很重要的，并且你可以将你所有的Struts应用迁移到你钟爱的框架中。不过，我认为这些数字对你选择一种框架开始你的项目来说不是重要的。我想在选择一种框架时最重要的是passion（激情）。你最想使用哪一个框架工作呢？或许如果你对一个框架很热情，你的生产力将获得极大的提高，而不是乏味的使用已经积累的技术。 另外，如果你由于生产力推动而不是激情，那么运用你已积累的技术去完成项目可能是一个好主意。</FONT></FONT></FONT></P>
<P minmax_bound="true">You might think that the number of skilled developers for framework X is important too. I don't think it is. I think the most important thing is to hire <EM minmax_bound="true">smart developers</EM>. A good developer can come up to speed on <EM minmax_bound="true">any</EM> framework in 2 weeks and be highly productive in 4 weeks. If not, the developer isn't that smart or the framework isn't that good. <IMG class=smiley title=;-) alt=;-) src="http://raibledesigns.com/images/smileys/wink.gif" minmax_bound="true"> <BR><FONT color=#0000ff><FONT style="BACKGROUND-COLOR: #ffffff">你可能认为某个框架有经验的开发者的数量也很重要，我不这么认为，我认为最重要的事情是雇用精明的开发者。一个好的开发人员能在两周时间内使用任何框架，并且在四周时间内能熟练运用。 如果不是这样的话， 这个开发人员就不是精明的开发者， 或者这个框架不是优秀的。</FONT><BR></FONT><BR>Just for kicks, I did some searching for other web frameworks as well:</P>
<UL class=glassList minmax_bound="true">
<LI minmax_bound="true">Rife: 0 
<LI minmax_bound="true">Wicket: 0 
<LI minmax_bound="true">Echo: 3 
<LI minmax_bound="true">Ruby on Rails: 1 
<LI minmax_bound="true">ASP .NET: 2876 </LI></UL>
<P minmax_bound="true">Now the question is - what kind of rates are these skills getting? I'd like to know what the average Rails and ASP .NET developers make. In Denver, Java developers seem to make between 65-85/hour when they're experienced contractors</P><img src ="http://www.blogjava.net/soochow_hhb/aggbug/5257.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2005-05-27 11:18 <a href="http://www.blogjava.net/soochow_hhb/archive/2005/05/27/5257.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Struts学习心得之Struts流程篇（3） －示例 续</title><link>http://www.blogjava.net/soochow_hhb/archive/2005/05/19/struts31.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Thu, 19 May 2005 02:57:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2005/05/19/struts31.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/4857.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2005/05/19/struts31.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/4857.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/4857.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;&nbsp;&nbsp;&nbsp; 第二步：实现controller。在Struts中继承自Action。调用Model，实现数据的深层次检验（email是否存在）和数据的插入，程序的跳转等。代码如下：SignAction.java&nbsp;1/**//**&nbsp;2&nbsp;*&nbsp;@author&nbsp;han&nbsp;3&nbsp;*&nbsp;soo...&nbsp;&nbsp;<a href='http://www.blogjava.net/soochow_hhb/archive/2005/05/19/struts31.html'>阅读全文</a><img src ="http://www.blogjava.net/soochow_hhb/aggbug/4857.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2005-05-19 10:57 <a href="http://www.blogjava.net/soochow_hhb/archive/2005/05/19/struts31.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Struts学习心得之Struts流程篇（3） －示例</title><link>http://www.blogjava.net/soochow_hhb/archive/2005/05/19/struts3.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Thu, 19 May 2005 02:31:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2005/05/19/struts3.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/4841.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2005/05/19/struts3.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/4841.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/4841.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 本文通过一个实例——用户注册——来说明Struts设置的一般流程和方法，中间设计到Struts的错误处理，资源文件使用和持久化工具Hibernate的使用，这些信息都可以从本blog中找到。
文章有一下几个部分组成：（1）实例介绍； （2） 不使用MVC模式；（3）使用MVC模式；（4）使用Struts实现用户注册的过程。&nbsp;&nbsp;<a href='http://www.blogjava.net/soochow_hhb/archive/2005/05/19/struts3.html'>阅读全文</a><img src ="http://www.blogjava.net/soochow_hhb/aggbug/4841.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2005-05-19 10:31 <a href="http://www.blogjava.net/soochow_hhb/archive/2005/05/19/struts3.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Struts学习心得之Struts流程篇（2） </title><link>http://www.blogjava.net/soochow_hhb/archive/2005/05/03/struts2.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Tue, 03 May 2005 01:35:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2005/05/03/struts2.html</guid><wfw:comment>http://www.blogjava.net/soochow_hhb/comments/3996.html</wfw:comment><comments>http://www.blogjava.net/soochow_hhb/archive/2005/05/03/struts2.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/soochow_hhb/comments/commentRss/3996.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/soochow_hhb/services/trackbacks/3996.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp; 上一节我们搭建了Struts的运行和开发环境。这一节着重讲述MVC的基本概念和与使用JSP/JavaBean模式开发Web应用的比较。<BR>（1）Tomcat的启动。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;从上一节的Tomcat的配置文件中，我们可以看到关于Struts的配置，当Tomcat启动时，会加载Struts的配置文件struts-config.xml，关于配置文件的内容请见<BR>&nbsp;（2）JSP/JavaBean开发Web应用<BR>&nbsp;&nbsp;&nbsp;&nbsp; 在asp的时代，我们还没有讨论什么开发模式，也没有顾及MVC（虽然MVC的概念早已出现）。用asp开发不外乎以下两种情况，一、就是直接将代码集成到asp文件中，经验多的话，会将常用的函数放至一起，引用时只需include即可；二、对于复杂的应用，如文件上传等，我们会用其他语音如VB、Delphi等写一个控件（ADO即属于此类）。<BR>&nbsp;&nbsp;&nbsp;&nbsp; 当java流行，JSP逐渐成熟，也正是模式、框架流行的时代，所以我们不管是看java的类库，还是看现在流行的框架，无一没有模式的存在。当你初接触JSP的时候，就可以看到书上说“尽量少的在jsp中插入Java代码”，这句话已是模式运用的端倪。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 下面我们先不管MVC，先从JSP/JavaBean来看Web的开发。这种模式很想上面提到的asp开发的第二种情况，我们将业务逻辑放到JavaBean中，只用JSP去表示页面。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 有过asp经验都知道，在接收表单数据的时候，我们不得不一个一个将数据接收过来，以至于有很长的一段如：CustomId ＝ request("CustomId")的代码。而在JSP中，我们不用这么繁琐，一个我们可以用EL直接表示即可，另外我们可以利用javaBean的introspection机制。直接将表单的数据映射到javabean的private变量中，当然javabean中必须包含getter和setter函数（有很幸运，很多的开发工具可以自动生成，又减少了工作量）。下面是一个示例。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">jsp:useBean&nbsp;id</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">prof</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;scope</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">page</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">register.Profile</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">jsp:setProperty&nbsp;name</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">prof</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;property</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN></DIV></DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 我们只要表单的action页面中，直接插入以上代码（这些代码就不用解释了吧），就可以将表单中的数据映射到register.Profile这个javabean中，所以我们可以在javabean中实现业务逻辑，譬如数据的插入、修改、删除等。从而可以减小甚至消除JSP中的java代码量。<BR>&nbsp;（3）MVC模式<BR>&nbsp;&nbsp;&nbsp;&nbsp; 上面提到的JSP/JavaBean与MVC模式很接近，但是还有很多差别。前者，我们可以看出，在javabean中有很多的逻辑代码，我们要控制页面的跳转，还是要在JSP中读取javabean中的某些标志，嵌入java代码来实现，这看起来显得有些笨拙。我们是否能在JSP和javabean中再加一层，专门来实现跳转即控制页面的输出呢？of course，这就是MVC的思想。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Struts就是一个实现MVC模式的WEB开发框架，在Struts中用JSP作为Viewer，javabean继承自ActionForm来映射JSP表单数据，用继承自Action的类来实现Controller，而Model没有特殊定义，它可以是EJB，普通Bean或者Web服务，总之Model中集成了业务逻辑的实现，在Controller中去调用，完成后Controller控制显示页面（jsp文件）。<BR>&nbsp;&nbsp;&nbsp;&nbsp; 这样一来，是不是业务流程非常的清晰？<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp; 下面我们付诸实践，实现一个用户注册的简单实例！<BR><img src ="http://www.blogjava.net/soochow_hhb/aggbug/3996.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2005-05-03 09:35 <a href="http://www.blogjava.net/soochow_hhb/archive/2005/05/03/struts2.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Struts学习心得之Struts流程篇（1）</title><link>http://www.blogjava.net/soochow_hhb/archive/2005/05/02/stucts1.html</link><dc:creator>soochow_hhb 以java论成败 以架构论英雄</dc:creator><author>soochow_hhb 以java论成败 以架构论英雄</author><pubDate>Mon, 02 May 2005 12:00:00 GMT</pubDate><guid>http://www.blogjava.net/soochow_hhb/archive/2005/05/02/stucts1.html</guid><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 刚接触Struts，刚接触MVC架构，或者刚接触任何新东西，我觉得首先要搞清楚流程，要对新事物有一个大概的、总体的认识，先有感性认识，先培养起来兴趣是非常重要的。下面就把我学习Struts的总体业务流程通过一个实例来进行概括，有什么错误和不妥之处，请你发表评论指教！
&nbsp;&nbsp;<a href='http://www.blogjava.net/soochow_hhb/archive/2005/05/02/stucts1.html'>阅读全文</a><img src ="http://www.blogjava.net/soochow_hhb/aggbug/3992.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/soochow_hhb/" target="_blank">soochow_hhb 以java论成败 以架构论英雄</a> 2005-05-02 20:00 <a href="http://www.blogjava.net/soochow_hhb/archive/2005/05/02/stucts1.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>