﻿<?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-&lt;b&gt;牛仔裤的夏天&lt;/b&gt;-随笔分类-Struts &amp; Hibernate</title><link>http://www.blogjava.net/luckyrobbie/category/8251.html</link><description>&lt;font size=-1&gt;JAVA是蓝色的-&lt;/font&gt;
&lt;!-- Start FastOnlineUsers.com --&gt;
&lt;a href="http://www.fastonlineusers.com"&gt;&lt;script type="text/javascript" src="http://fastonlineusers.com/on2.php?d=www.blogjava.net/luckyrobbie"&gt;&lt;/script&gt; online&lt;/a&gt;&lt;!-- End FastOnlineUsers.com --&gt;</description><language>zh-cn</language><lastBuildDate>Wed, 28 Feb 2007 07:45:09 GMT</lastBuildDate><pubDate>Wed, 28 Feb 2007 07:45:09 GMT</pubDate><ttl>60</ttl><item><title>Hibernate学习(1)</title><link>http://www.blogjava.net/luckyrobbie/archive/2006/04/18/41660.html</link><dc:creator>luckyrobbie</dc:creator><author>luckyrobbie</author><pubDate>Tue, 18 Apr 2006 07:53:00 GMT</pubDate><guid>http://www.blogjava.net/luckyrobbie/archive/2006/04/18/41660.html</guid><wfw:comment>http://www.blogjava.net/luckyrobbie/comments/41660.html</wfw:comment><comments>http://www.blogjava.net/luckyrobbie/archive/2006/04/18/41660.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/luckyrobbie/comments/commentRss/41660.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/luckyrobbie/services/trackbacks/41660.html</trackback:ping><description><![CDATA[
		<p>1. 域模型也称为设计模型，由以下内容组成：<br />    具有状态和行为的域对象<br />    域对象之间的关系<br /><br />2. 域对象(Domain Object) - 对真实世界的实体的软件抽象，也叫业务对象(Business Object)，分为：<br />    实体域对象(实体EJB，POJO)，为每个实体域对象分配OID(Object Identifier)<br />    过程域对象(Session Bean, Message Driven Bean, Java Bean)<br />    事件域对象(事件触发)<br />  三种域对象位于业务逻辑层<br /><br />3. 域对象之间的关系<br />    关联(Association)：one to one, one to many, many to many, 单向, 双向<br />    依赖(Dependency)：类与类之间的访问关系，如果A访问B的属性或者方法，或者A负责实例化B，则A依赖B。过程域对象往往依赖实体域对象。<br />    聚集(Aggregation)：整体与部分之间的关系，实体域对象之间常见。聚集关系和关联关系有相同的形式，区别是：对于聚集关系，部分类的对象不能单独存在，它的生命周期依赖于整体类的对象的生命周期；对于关联关系的2个类，可以分别单独存在。<br />    一般化(Generalization)<br /><br />     <br />    </p>
<img src ="http://www.blogjava.net/luckyrobbie/aggbug/41660.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/luckyrobbie/" target="_blank">luckyrobbie</a> 2006-04-18 15:53 <a href="http://www.blogjava.net/luckyrobbie/archive/2006/04/18/41660.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>刚刚解决一个hsqldb的初级问题</title><link>http://www.blogjava.net/luckyrobbie/archive/2006/04/06/39688.html</link><dc:creator>luckyrobbie</dc:creator><author>luckyrobbie</author><pubDate>Thu, 06 Apr 2006 14:32:00 GMT</pubDate><guid>http://www.blogjava.net/luckyrobbie/archive/2006/04/06/39688.html</guid><wfw:comment>http://www.blogjava.net/luckyrobbie/comments/39688.html</wfw:comment><comments>http://www.blogjava.net/luckyrobbie/archive/2006/04/06/39688.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/luckyrobbie/comments/commentRss/39688.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/luckyrobbie/services/trackbacks/39688.html</trackback:ping><description><![CDATA[
		<p>这2天用hsqldb做hibernate测试，做insert时，不论用hibernate的方法还是用jdbc的方法，显示的一切信息都是成功的，可是后来打开hsqldb的manager，发现table里面没有记录insert，<img height="20" src="http://www.blogjava.net/Emoticons/QQ/12.gif" width="20" border="0" />郁闷之极，觉得应该是hsqldb的配置问题<br /><br />于是打开那个script文件，最后找到这句配置：SET WRITE_DELAY 20<br />改为SET WRITE_DELAY 0后，一切正常了<img height="19" src="http://www.blogjava.net/Emoticons/QQ/22.gif" width="19" border="0" /></p>
<img src ="http://www.blogjava.net/luckyrobbie/aggbug/39688.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/luckyrobbie/" target="_blank">luckyrobbie</a> 2006-04-06 22:32 <a href="http://www.blogjava.net/luckyrobbie/archive/2006/04/06/39688.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>struts中＜html:messages＞标签的使用</title><link>http://www.blogjava.net/luckyrobbie/archive/2006/03/27/37548.html</link><dc:creator>luckyrobbie</dc:creator><author>luckyrobbie</author><pubDate>Mon, 27 Mar 2006 02:02:00 GMT</pubDate><guid>http://www.blogjava.net/luckyrobbie/archive/2006/03/27/37548.html</guid><wfw:comment>http://www.blogjava.net/luckyrobbie/comments/37548.html</wfw:comment><comments>http://www.blogjava.net/luckyrobbie/archive/2006/03/27/37548.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/luckyrobbie/comments/commentRss/37548.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/luckyrobbie/services/trackbacks/37548.html</trackback:ping><description><![CDATA[
		<div>
				<font face="Arial">Action中的代码:</font>
		</div>
		<div>
				<font face="Arial">ActionMessages actionMessages=new ActionMessages();</font>
		</div>
		<div>
				<font face="Arial">actionMessages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("......"));</font>
		</div>
		<div>
				<font face="Arial">saveMessages(request, actionMessages);</font>
		</div>
		<div>
				<font face="Arial">
				</font> </div>
		<div>
				<font face="Arial">对应的jsp中:</font>
		</div>
		<div>
				<font face="Arial">&lt;html:messages id="message" message="true"&gt;</font>
		</div>
		<div>
				<font face="Arial">      &lt;bean:write name="message"/&gt;</font>
		</div>
		<div>
				<font face="Arial">&lt;/html:messages&gt;</font>
		</div>
		<ul>
				<li>
						<font face="Arial">name : 指定ActionMessages存放在request或者session内的属性key.</font>
				</li>
				<li>
						<font face="Arial">message: 指定消息的来源, 如果为true, 对应于key=Globals.MESSAGE_KEY的ActionMessages对象, 此时name属性无效；如果为false, 则根据name属性检索ActionMessages对象, 如果没有设置name, 默认为Globals.ERROR_KEY. message属性的默认值为false.</font>
				</li>
		</ul>
<img src ="http://www.blogjava.net/luckyrobbie/aggbug/37548.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/luckyrobbie/" target="_blank">luckyrobbie</a> 2006-03-27 10:02 <a href="http://www.blogjava.net/luckyrobbie/archive/2006/03/27/37548.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JSF与Struts的异同</title><link>http://www.blogjava.net/luckyrobbie/archive/2006/03/24/37127.html</link><dc:creator>luckyrobbie</dc:creator><author>luckyrobbie</author><pubDate>Fri, 24 Mar 2006 00:58:00 GMT</pubDate><guid>http://www.blogjava.net/luckyrobbie/archive/2006/03/24/37127.html</guid><wfw:comment>http://www.blogjava.net/luckyrobbie/comments/37127.html</wfw:comment><comments>http://www.blogjava.net/luckyrobbie/archive/2006/03/24/37127.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/luckyrobbie/comments/commentRss/37127.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/luckyrobbie/services/trackbacks/37127.html</trackback:ping><description><![CDATA[
		<font style="BACKGROUND-COLOR: #0000ff">
				<font style="BACKGROUND-COLOR: #ffff99" color="#3300ff">
						<strong>是学习JSF的时候了，请看下面摘抄的文章</strong>
				</font>
				<br />
		</font>
		<br />Struts和JSF/Tapestry都属于表现层框架，这两种分属不同性质的框架，后者是一种事件驱动型的组件模型，而Struts只是单纯的MVC模式框架，老外总是急吼吼说事件驱动型就比MVC模式框架好，何以见得，我们下面进行详细分析比较一下到底是怎么回事？
<p>　　首先事件是指从客户端页面（浏览器）由用户操作触发的事件，Struts使用Action来接受浏览器表单提交的事件，这里使用了Command模式，每个继承Action的子类都必须实现一个方法execute。</p><p>　　在struts中，实际是一个表单Form对应一个Action类(或DispatchAction)，换一句话说：在Struts中实际是一个表单只能对应一个事件，struts这种事件方式称为application event，application event和component event相比是一种粗粒度的事件。</p><p>　　struts重要的表单对象ActionForm是一种对象，它代表了一种应用，这个对象中至少包含几个字段，这些字段是Jsp页面表单中的input字段，因为一个表单对应一个事件，所以，当我们需要将事件粒度细化到表单中这些字段时，也就是说，一个字段对应一个事件时，单纯使用Struts就不太可能，当然通过结合JavaScript也是可以转弯实现的。</p><p>　　而这种情况使用JSF就可以方便实现，</p><table width="90%" bgcolor="#cccccc" border="0"><tbody><tr><td>&lt;h:inputText id="userId" value="#{login.userId}"&gt;<br />　　&lt;f:<strong>valueChangeListener</strong> type="logindemo.UserLoginChanged" /&gt;<br />&lt;/h:inputText&gt;</td></tr></tbody></table><p>　　#{login.userId}表示从名为login的JavaBean的getUserId获得的结果，这个功能使用struts也可以实现，name="login" property="userId" </p><p>　　关键是第二行，这里表示如果userId的值改变并且确定提交后，将触发调用类UserLoginChanged的processValueChanged(...)方法。</p><p>　　JSF可以为组件提供两种事件：Value Changed和 Action. 前者我们已经在上节见识过用处，后者就相当于struts中表单提交Action机制，它的JSF写法如下：</p><table width="90%" bgcolor="#cccccc" border="0"><tbody><tr><td>&lt;h:commandButton id="login" commandName="login"&gt;<br />　　&lt;f:<strong>actionListener</strong> type=”logindemo.LoginActionListener” /&gt;<br />&lt;/h:commandButton&gt;</td></tr></tbody></table><p>　　从代码可以看出，这两种事件是通过Listerner这样观察者模式贴在具体组件字段上的，而Struts此类事件是原始的一种表单提交Submit触发机制。如果说前者比较语言化（编程语言习惯做法类似Swing编程）；后者是属于WEB化，因为它是来自Html表单，如果你起步是从Perl/PHP开始，反而容易接受Struts这种风格。</p><img src ="http://www.blogjava.net/luckyrobbie/aggbug/37127.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/luckyrobbie/" target="_blank">luckyrobbie</a> 2006-03-24 08:58 <a href="http://www.blogjava.net/luckyrobbie/archive/2006/03/24/37127.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Struts 知识补充 - 多模块配置(听课笔记)</title><link>http://www.blogjava.net/luckyrobbie/archive/2006/03/22/36874.html</link><dc:creator>luckyrobbie</dc:creator><author>luckyrobbie</author><pubDate>Wed, 22 Mar 2006 08:04:00 GMT</pubDate><guid>http://www.blogjava.net/luckyrobbie/archive/2006/03/22/36874.html</guid><wfw:comment>http://www.blogjava.net/luckyrobbie/comments/36874.html</wfw:comment><comments>http://www.blogjava.net/luckyrobbie/archive/2006/03/22/36874.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/luckyrobbie/comments/commentRss/36874.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/luckyrobbie/services/trackbacks/36874.html</trackback:ping><description><![CDATA[
		<p>
				<font face="Arial" size="2">1.为每个模块准备一个配置文件，如：<br />  struts－config.xml（缺省配置文件），<br />  struts－config－customer.xml，<br />  struts－config－order.xml<br />每个配置文件的写法可以参照struts－config.xml<br /><br />2.配置web.xml文件</font>
		</p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<font face="Arial" size="2">
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
						<span style="COLOR: #000000">&lt;</span>
						<span style="COLOR: #000000">servlet</span>
						<span style="COLOR: #000000">&gt;</span>
				</font>
				<span style="COLOR: #000000">
						<br />
						<font face="Arial" size="2">
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
						</font>
				</span>
				<font face="Arial">
						<font size="2">
								<span style="COLOR: #000000">&lt;</span>
								<span style="COLOR: #000000">init</span>
								<span style="COLOR: #000000">-</span>
								<span style="COLOR: #000000">param</span>
								<span style="COLOR: #000000">&gt;</span>
								<span style="COLOR: #000000">    </span>
								<span style="COLOR: #008000">//</span>
								<span style="COLOR: #008000">缺省模块</span>
						</font>
				</font>
				<span style="COLOR: #008000">
						<br />
						<font face="Arial" size="2">
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
						</font>
				</span>
				<font face="Arial">
						<font size="2">
								<span style="COLOR: #000000">    </span>
								<span style="COLOR: #000000">&lt;</span>
								<span style="COLOR: #000000">param</span>
								<span style="COLOR: #000000">-</span>
								<span style="COLOR: #000000">name</span>
								<span style="COLOR: #000000">&gt;</span>
								<span style="COLOR: #000000">config</span>
								<span style="COLOR: #000000">&lt;/</span>
								<span style="COLOR: #000000">param</span>
								<span style="COLOR: #000000">-</span>
								<span style="COLOR: #000000">name</span>
								<span style="COLOR: #000000">&gt;</span>
						</font>
				</font>
				<span style="COLOR: #000000">
						<br />
						<font face="Arial" size="2">
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </font>
				</span>
				<font face="Arial" size="2">
						<span style="COLOR: #000000">&lt;</span>
						<span style="COLOR: #000000">param</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">value</span>
						<span style="COLOR: #000000">&gt;/</span>
						<span style="COLOR: #000000">WEB</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">INF</span>
						<span style="COLOR: #000000">/</span>
						<span style="COLOR: #000000">struts</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">config.xml</span>
						<span style="COLOR: #000000">&lt;/</span>
						<span style="COLOR: #000000">param</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">value</span>
						<span style="COLOR: #000000">&gt;</span>
				</font>
				<span style="COLOR: #000000">
						<br />
						<font face="Arial" size="2">
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
						</font>
				</span>
				<font face="Arial">
						<font size="2">
								<span style="COLOR: #000000">&lt;/</span>
								<span style="COLOR: #000000">init</span>
								<span style="COLOR: #000000">-</span>
								<span style="COLOR: #000000">param</span>
								<span style="COLOR: #000000">&gt;</span>
						</font>
				</font>
				<span style="COLOR: #000000">
						<br />
						<font face="Arial" size="2">
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
								<br />
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
						</font>
				</span>
				<font face="Arial">
						<font size="2">
								<span style="COLOR: #000000">&lt;</span>
								<span style="COLOR: #000000">init</span>
								<span style="COLOR: #000000">-</span>
								<span style="COLOR: #000000">param</span>
								<span style="COLOR: #000000">&gt;</span>
								<span style="COLOR: #000000">     </span>
								<span style="COLOR: #008000">//</span>
								<span style="COLOR: #008000">customer模块</span>
						</font>
				</font>
				<span style="COLOR: #008000">
						<br />
						<font face="Arial" size="2">
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
						</font>
				</span>
				<font face="Arial">
						<font size="2">
								<span style="COLOR: #000000">    </span>
								<span style="COLOR: #000000">&lt;</span>
								<span style="COLOR: #000000">param</span>
								<span style="COLOR: #000000">-</span>
								<span style="COLOR: #000000">name</span>
								<span style="COLOR: #000000">&gt;</span>
								<span style="COLOR: #000000">config</span>
								<span style="COLOR: #000000">/</span>
								<span style="COLOR: #000000">customer</span>
								<span style="COLOR: #000000">&lt;/</span>
								<span style="COLOR: #000000">param</span>
								<span style="COLOR: #000000">-</span>
								<span style="COLOR: #000000">name</span>
								<span style="COLOR: #000000">&gt;</span>
						</font>
				</font>
				<span style="COLOR: #000000">
						<br />
						<font face="Arial" size="2">
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </font>
				</span>
				<font face="Arial" size="2">
						<span style="COLOR: #000000">&lt;</span>
						<span style="COLOR: #000000">param</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">value</span>
						<span style="COLOR: #000000">&gt;/</span>
						<span style="COLOR: #000000">WEB</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">INF</span>
						<span style="COLOR: #000000">/</span>
						<span style="COLOR: #000000">struts</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">config</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">customer.xml</span>
						<span style="COLOR: #000000">&lt;/</span>
						<span style="COLOR: #000000">param</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">value</span>
						<span style="COLOR: #000000">&gt;</span>
				</font>
				<span style="COLOR: #000000">
						<br />
						<font face="Arial" size="2">
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
						</font>
				</span>
				<font face="Arial">
						<font size="2">
								<span style="COLOR: #000000">&lt;/</span>
								<span style="COLOR: #000000">init</span>
								<span style="COLOR: #000000">-</span>
								<span style="COLOR: #000000">param</span>
								<span style="COLOR: #000000">&gt;</span>
						</font>
				</font>
				<span style="COLOR: #000000">
						<br />
						<font face="Arial" size="2">
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
								<br />
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
						</font>
				</span>
				<font face="Arial">
						<font size="2">
								<span style="COLOR: #000000">&lt;</span>
								<span style="COLOR: #000000">init</span>
								<span style="COLOR: #000000">-</span>
								<span style="COLOR: #000000">param</span>
								<span style="COLOR: #000000">&gt;</span>
								<span style="COLOR: #000000">     </span>
								<span style="COLOR: #008000">//</span>
								<span style="COLOR: #008000">order模块</span>
						</font>
				</font>
				<span style="COLOR: #008000">
						<br />
						<font face="Arial" size="2">
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
						</font>
				</span>
				<font face="Arial">
						<font size="2">
								<span style="COLOR: #000000">    </span>
								<span style="COLOR: #000000">&lt;</span>
								<span style="COLOR: #000000">param</span>
								<span style="COLOR: #000000">-</span>
								<span style="COLOR: #000000">name</span>
								<span style="COLOR: #000000">&gt;</span>
								<span style="COLOR: #000000">config</span>
								<span style="COLOR: #000000">/</span>
								<span style="COLOR: #000000">order</span>
								<span style="COLOR: #000000">&lt;/</span>
								<span style="COLOR: #000000">param</span>
								<span style="COLOR: #000000">-</span>
								<span style="COLOR: #000000">name</span>
								<span style="COLOR: #000000">&gt;</span>
						</font>
				</font>
				<span style="COLOR: #000000">
						<br />
						<font face="Arial" size="2">
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </font>
				</span>
				<font face="Arial" size="2">
						<span style="COLOR: #000000">&lt;</span>
						<span style="COLOR: #000000">param</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">value</span>
						<span style="COLOR: #000000">&gt;/</span>
						<span style="COLOR: #000000">WEB</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">INF</span>
						<span style="COLOR: #000000">/</span>
						<span style="COLOR: #000000">struts</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">config</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">order.xml</span>
						<span style="COLOR: #000000">&lt;/</span>
						<span style="COLOR: #000000">param</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">value</span>
						<span style="COLOR: #000000">&gt;</span>
				</font>
				<span style="COLOR: #000000">
						<br />
						<font face="Arial" size="2">
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
						</font>
				</span>
				<font face="Arial">
						<font size="2">
								<span style="COLOR: #000000">&lt;/</span>
								<span style="COLOR: #000000">init</span>
								<span style="COLOR: #000000">-</span>
								<span style="COLOR: #000000">param</span>
								<span style="COLOR: #000000">&gt;</span>
						</font>
				</font>
				<span style="COLOR: #000000">
						<br />
						<font face="Arial" size="2">
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
						</font>
				</span>
				<font face="Arial">
						<font size="2">
								<span style="COLOR: #000000">&lt;/</span>
								<span style="COLOR: #000000">servlet</span>
								<span style="COLOR: #000000">&gt;</span>
						</font>
				</font>
		</div>
		<p>
				<font face="Arial" size="2">3.准备各个模块所需的ActionForm、Action和JSP等资源<br /><br />在多模块间进行全局转发<br />struts-config.xml: </font>
		</p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<font face="Arial" size="2">
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
						<span style="COLOR: #000000">&lt;</span>
						<span style="COLOR: #000000">struts</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">config</span>
						<span style="COLOR: #000000">&gt;</span>
				</font>
				<span style="COLOR: #000000">
						<br />
						<font face="Arial" size="2">
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </font>
				</span>
				<font face="Arial" size="2">
						<span style="COLOR: #000000">&lt;</span>
						<span style="COLOR: #000000">global</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">forwards</span>
						<span style="COLOR: #000000">&gt;</span>
				</font>
				<span style="COLOR: #000000">
						<br />
						<font face="Arial" size="2">
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </font>
				</span>
				<font face="Arial" size="2">
						<span style="COLOR: #000000">&lt;</span>
						<span style="COLOR: #000000">forword name</span>
						<span style="COLOR: #000000">=</span>
				</font>
				<font face="Arial">
						<font size="2">
								<span style="COLOR: #000000">“toModuleB”<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />        contextRelative</span>
								<span style="COLOR: #000000">=</span>
								<span style="COLOR: #000000">“</span>
								<span style="COLOR: #0000ff">true</span>
						</font>
				</font>
				<font face="Arial">
						<font size="2">
								<span style="COLOR: #000000">”<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />        path</span>
								<span style="COLOR: #000000">=</span>
								<span style="COLOR: #000000">“</span>
								<span style="COLOR: #000000">/</span>
								<span style="COLOR: #000000">moduleB</span>
								<span style="COLOR: #000000">/</span>
								<span style="COLOR: #000000">index.</span>
								<span style="COLOR: #0000ff">do</span>
						</font>
				</font>
				<font face="Arial">
						<font size="2">
								<span style="COLOR: #000000">”<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />        redirect</span>
								<span style="COLOR: #000000">=</span>
								<span style="COLOR: #000000">“</span>
								<span style="COLOR: #0000ff">true</span>
								<span style="COLOR: #000000">” </span>
								<span style="COLOR: #000000">/&gt;</span>
						</font>
				</font>
				<span style="COLOR: #000000">
						<br />
						<font face="Arial" size="2">
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </font>
				</span>
				<font face="Arial" size="2">
						<span style="COLOR: #000000">&lt;/</span>
						<span style="COLOR: #000000">global</span>
						<span style="COLOR: #000000">-</span>
						<span style="COLOR: #000000">forwards</span>
						<span style="COLOR: #000000">&gt;</span>
				</font>
				<span style="COLOR: #000000">
						<br />
						<font face="Arial" size="2">
								<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
						</font>
				</span>
				<font face="Arial">
						<font size="2">
								<span style="COLOR: #000000">&lt;/</span>
								<span style="COLOR: #000000">struts</span>
								<span style="COLOR: #000000">-</span>
								<span style="COLOR: #000000">config</span>
								<span style="COLOR: #000000">&gt;</span>
						</font>
				</font>
		</div>
<img src ="http://www.blogjava.net/luckyrobbie/aggbug/36874.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/luckyrobbie/" target="_blank">luckyrobbie</a> 2006-03-22 16:04 <a href="http://www.blogjava.net/luckyrobbie/archive/2006/03/22/36874.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>显示结果集的标签</title><link>http://www.blogjava.net/luckyrobbie/archive/2006/03/10/34648.html</link><dc:creator>luckyrobbie</dc:creator><author>luckyrobbie</author><pubDate>Fri, 10 Mar 2006 05:12:00 GMT</pubDate><guid>http://www.blogjava.net/luckyrobbie/archive/2006/03/10/34648.html</guid><wfw:comment>http://www.blogjava.net/luckyrobbie/comments/34648.html</wfw:comment><comments>http://www.blogjava.net/luckyrobbie/archive/2006/03/10/34648.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/luckyrobbie/comments/commentRss/34648.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/luckyrobbie/services/trackbacks/34648.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 单位里的查询系统是基于struts的，在结果集显示的处理上都是用&nbsp;&lt;logic:iterate id=".." indexId="id" name=".." scope="request"&gt; 然后在&lt;bean:write name=".." property=".."&gt; 这样子对付的，后来觉得比较麻烦，就写了一个显示结果集的标签行记录用HashMap保存 ...&nbsp;&nbsp;<a href='http://www.blogjava.net/luckyrobbie/archive/2006/03/10/34648.html'>阅读全文</a><img src ="http://www.blogjava.net/luckyrobbie/aggbug/34648.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/luckyrobbie/" target="_blank">luckyrobbie</a> 2006-03-10 13:12 <a href="http://www.blogjava.net/luckyrobbie/archive/2006/03/10/34648.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>第一个struts+hibernate实验</title><link>http://www.blogjava.net/luckyrobbie/archive/2006/01/26/29228.html</link><dc:creator>luckyrobbie</dc:creator><author>luckyrobbie</author><pubDate>Thu, 26 Jan 2006 02:49:00 GMT</pubDate><guid>http://www.blogjava.net/luckyrobbie/archive/2006/01/26/29228.html</guid><wfw:comment>http://www.blogjava.net/luckyrobbie/comments/29228.html</wfw:comment><comments>http://www.blogjava.net/luckyrobbie/archive/2006/01/26/29228.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/luckyrobbie/comments/commentRss/29228.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/luckyrobbie/services/trackbacks/29228.html</trackback:ping><description><![CDATA[<P><FONT size=2>参考原文地址 </FONT><A href="http://homepage.mac.com/edahand/projects/java/example1.html"><FONT size=2>http://homepage.mac.com/edahand/projects/java/example1.html</FONT></A><BR><BR><FONT size=2>1 &nbsp;在E盘建立一个目录sandh, 然后把那个空的struts-blank.war解压到这下面作为struts模板，把hibernate3.1里面的jar文件拷贝到/sandh/web-inf/lib下面，ehcache.xml拷贝到/sand/web-inf/src/java下面。<BR><BR>2&nbsp; 在tomcat下配置datasource命名为jdbc/aix，然后建立一个新的context名字为sand，在sand下建一个新的资源连接jdbc/aix，作为hibernate.cfg.xml中hibernate.connection.datasouce引用值。<BR><BR>3&nbsp; 在sybase中新建一个表item<BR></P>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">create&nbsp;table&nbsp;dbo.item&nbsp;(<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>id&nbsp;&nbsp;numeric(</SPAN><SPAN style="COLOR: #000000">18</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">)&nbsp;&nbsp;identity,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>name&nbsp;&nbsp;&nbsp;&nbsp;varchar(</SPAN><SPAN style="COLOR: #000000">32</SPAN><SPAN style="COLOR: #000000">)&nbsp;not&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>description&nbsp;text&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>constraint&nbsp;PK_ITEM&nbsp;PRIMARY&nbsp;KEY&nbsp;&nbsp;NONCLUSTERED&nbsp;(&nbsp;id&nbsp;)<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>)<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN></DIV>
<P><BR>4&nbsp; 在/sandh/web-inf/src/java下面建立以下文件<BR></FONT><FONT style="BACKGROUND-COLOR: #d3d3d3" color=#000000><FONT size=2><FONT style="BACKGROUND-COLOR: #ffffff">log4j.properties&nbsp;<BR>hibernate.cfg.xml<BR>Item.hbm.xml<BR>HibernateUtil.java<BR>Item.java<BR>AddItemAction.java<BR>ItemService.java</FONT><BR></FONT><FONT style="BACKGROUND-COLOR: #ffffff" color=#000000 size=2>在/sandh/web-inf/src下面新建build.xml文件，然后ant compile。<BR>在/sandh/pages下新建AddItem.jsp文件<BR><BR>5&nbsp;&nbsp; 修改/sandh/web-inf/struts-config.xml文件，内容如下：</P>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">struts</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">config</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">form</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">beans</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">form</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">bean&nbsp;name</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">addItemForm</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">org.apache.struts.validator.DynaValidatorForm</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">form</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">property&nbsp;name</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">name</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;type</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">java.lang.String</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">form</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">property&nbsp;name</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">description</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;type</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">java.lang.String</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">form</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">bean</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">form</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">beans</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">global</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">forwards</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">forward&nbsp;name</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">welcome</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;path</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/items.do</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">global</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">forwards</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">action</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">mappings</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">action<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/items</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">org.apache.struts.actions.ForwardAction</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parameter</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/pages/AddItem.jsp</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">action<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/addItem</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">com.fan.hibernate.AddItemAction</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">addItemForm</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scope</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">request</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;validate</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">true</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;input</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/pages/AddItem.jsp</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">forward&nbsp;name</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">success</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;path</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/pages/AddItem.jsp</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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">action</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">action</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">mappings</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">message</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">resources&nbsp;parameter</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">MessageResources</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">false</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">plug</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">in&nbsp;className</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">org.apache.struts.validator.ValidatorPlugIn</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">set</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">property&nbsp;property</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">pathnames</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;value</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml</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>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">plug</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">in</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">struts</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">config</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN></DIV>
<P><BR></FONT></FONT></P>
<P><FONT style="BACKGROUND-COLOR: #d3d3d3" color=#000000><FONT style="BACKGROUND-COLOR: #ffffff" color=#000000 size=2><BR>修改/sandh/web-inf/validation.xml文件，为addItemForm增加动态验证，内容如下：<BR></P>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">formset</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">form&nbsp;name</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">addItemForm</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">field&nbsp;property</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">name</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;depends</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">required</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">arg&nbsp;key</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">name</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;resource</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">false</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">field</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">field&nbsp;property</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">description</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;depends</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">required</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">arg&nbsp;key</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">description</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;resource</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">false</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">field</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">form</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">formset</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></DIV>
<P><BR>6&nbsp;&nbsp; 在tomcat下面测试一下吧。http://127.0.0.1:8080/sand<BR><BR></FONT></FONT><FONT style="BACKGROUND-COLOR: #d3d3d3" color=#000000><FONT style="BACKGROUND-COLOR: #ffffff" color=#000000><FONT size=2>7&nbsp;&nbsp; 测试的时候发现2个问题：<BR>首先，如果在/sandh/web-inf/classes下面没有ehcache.xml这个文件，会报这个错误，</FONT><FONT style="BACKGROUND-COLOR: #ffffff" color=#000000><FONT size=2>No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath:.....这个文件是hibernate缓存配置文件，以后在学习。<BR>另外在log文件中一直发现这个警告：Could not bind factory to JNDI&nbsp;javax.naming.NamingException: Context is read only..... 网上查找后发现只要在hibernate.cfg.xml文件的&lt;session-factory name="java:/hibernate/HibernateFactory"&gt; 中把name=....去掉就好了，否则会自动把name注册进jndi中失败而发出警告。<BR><BR>8&nbsp;&nbsp; 所有文件打包在这里 </FONT><A href="/Files/luckyrobbie/sandh.rar"><FONT size=2>http://www.blogjava.net/Files/luckyrobbie/sandh.rar</FONT></A><FONT size=2>&nbsp;里面lib下面的文件自己添进去吧。<BR></FONT></FONT><BR><BR></FONT><BR></P></FONT><img src ="http://www.blogjava.net/luckyrobbie/aggbug/29228.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/luckyrobbie/" target="_blank">luckyrobbie</a> 2006-01-26 10:49 <a href="http://www.blogjava.net/luckyrobbie/archive/2006/01/26/29228.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>直接传递ActionForm中的property到下一个page</title><link>http://www.blogjava.net/luckyrobbie/archive/2005/12/15/24064.html</link><dc:creator>luckyrobbie</dc:creator><author>luckyrobbie</author><pubDate>Thu, 15 Dec 2005 08:16:00 GMT</pubDate><guid>http://www.blogjava.net/luckyrobbie/archive/2005/12/15/24064.html</guid><wfw:comment>http://www.blogjava.net/luckyrobbie/comments/24064.html</wfw:comment><comments>http://www.blogjava.net/luckyrobbie/archive/2005/12/15/24064.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/luckyrobbie/comments/commentRss/24064.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/luckyrobbie/services/trackbacks/24064.html</trackback:ping><description><![CDATA[今天看了一个别人的帖子才发现刚刚做的项目里面存在一些画蛇添足的实现方法。<BR><BR>在action处理完控制逻辑后，把dto处理结果扔给显示层表示后，在显示层里面如果要显示一些在ActionForm中的property，本来是通过在action中用request.setAttribute(..)传递的，其实没这个必要。<BR><BR>Action处理完毕后，本来传递给action的form在request域里面是依旧存在的，所以在输出的显示页面上只要用&lt;bean:write name="actionformname" property="field" scope="request"/&gt; 就ok了。<BR><BR>打个哈欠，以前写的代码也懒得去改了，反正也没多大的不适，嘿嘿<BR><BR><IMG height=434 alt=468c05860200005t.jpg src="http://www.blogjava.net/images/blogjava_net/luckyrobbie/468c05860200005t.jpg" width=300 border=0><img src ="http://www.blogjava.net/luckyrobbie/aggbug/24064.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/luckyrobbie/" target="_blank">luckyrobbie</a> 2005-12-15 16:16 <a href="http://www.blogjava.net/luckyrobbie/archive/2005/12/15/24064.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>action中对于actionform的传递</title><link>http://www.blogjava.net/luckyrobbie/archive/2005/12/13/23734.html</link><dc:creator>luckyrobbie</dc:creator><author>luckyrobbie</author><pubDate>Tue, 13 Dec 2005 13:52:00 GMT</pubDate><guid>http://www.blogjava.net/luckyrobbie/archive/2005/12/13/23734.html</guid><wfw:comment>http://www.blogjava.net/luckyrobbie/comments/23734.html</wfw:comment><comments>http://www.blogjava.net/luckyrobbie/archive/2005/12/13/23734.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/luckyrobbie/comments/commentRss/23734.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/luckyrobbie/services/trackbacks/23734.html</trackback:ping><description><![CDATA[
		<p>
		</p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				<span style="COLOR: #0000ff">public</span>
				<span style="COLOR: #000000"> ActionForward execute(ActionMapping mapping, ActionForm form,<br /><img id="Codehighlighter1_129_283_Open_Image" onclick="this.style.display='none'; Codehighlighter1_129_283_Open_Text.style.display='none'; Codehighlighter1_129_283_Closed_Image.style.display='inline'; Codehighlighter1_129_283_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_129_283_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_129_283_Closed_Text.style.display='none'; Codehighlighter1_129_283_Open_Image.style.display='inline'; Codehighlighter1_129_283_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top" />   HttpServletRequest request, HttpServletResponse response)</span>
				<span id="Codehighlighter1_129_283_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
						<img src="http://www.blogjava.net/images/dot.gif" />
				</span>
				<span id="Codehighlighter1_129_283_Open_Text">
						<span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" /><br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" /></span>
						<span style="COLOR: #008000">//</span>
						<span style="COLOR: #008000">***********</span>
						<span style="COLOR: #008000">
								<br />
								<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />
						</span>
						<span style="COLOR: #000000">
								<br />
								<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />  DynaValidatorForm f</span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000">(DynaValidatorForm) form;<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" /><br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />  String a</span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000">(String) f.get(</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">A</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">);   <br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" /><br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />  String b</span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000">(String) f.get(</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">B</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">);   <br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" /><br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" /></span>
						<span style="COLOR: #008000">//</span>
						<span style="COLOR: #008000">***********</span>
						<span style="COLOR: #008000">
								<br />
								<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />
						</span>
						<span style="COLOR: #000000">
								<br />
								<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span>
				</span>
		</div>
		<p>对于上面的actionform的传递，本来以为一定要通过提交&lt;html:form.../&gt;才能接收的，后来发现其实通过参数的传递也可以实现。</p>
		<p>例如上面的actionform, 如果有2个field, 分别是A和B, 如果不通过提交form的方法，直接用带参数的连接表示, 那么通过这个做法也可以正确的用f.get(..)方法得到数值.  </p>
		<p>
				<a href="http://localhost:8080/app/myaction.do?A=abc&amp;B=def">
						<font color="#ff6600">http://localhost:8080/app/myaction.do?A=abc&amp;B=def</font>
				</a>
		</p>
		<p>由此可见，如果分别3个页面page a, page b and page c. page a中有一个form, 提交后产生page b, 对page b中的链接提交后产生page c. 那么<font color="#ff6600">page b 和 page c 可以通过一个action来实现, 只要保证page b中关于action的连接后面加的参数名字和actionform的field名字一致就可以了。<br /><br /><img height="416" alt="468c05860200007v.jpg" src="http://www.blogjava.net/images/blogjava_net/luckyrobbie/468c05860200007v.jpg" width="300" border="0" /></font></p>
<img src ="http://www.blogjava.net/luckyrobbie/aggbug/23734.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/luckyrobbie/" target="_blank">luckyrobbie</a> 2005-12-13 21:52 <a href="http://www.blogjava.net/luckyrobbie/archive/2005/12/13/23734.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>