<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>若水博客 &#187; web开发</title>
	<atom:link href="http://www.ruisin.net/categories/web-develop/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ruisin.net</link>
	<description>总想着还有明天是会吃大亏的</description>
	<pubDate>Mon, 18 Aug 2008 11:40:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>使用Struts2+Spring+Hibernate+sitemesh做的一个在线音乐站点</title>
		<link>http://www.ruisin.net/2008/02/11/a-music-site-example/</link>
		<comments>http://www.ruisin.net/2008/02/11/a-music-site-example/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 07:51:02 +0000</pubDate>
		<dc:creator>Ruisin</dc:creator>
		
		<category><![CDATA[web开发]]></category>

		<category><![CDATA[hibernate]]></category>

		<category><![CDATA[sitemesh]]></category>

		<category><![CDATA[spring]]></category>

		<category><![CDATA[struts2]]></category>

		<guid isPermaLink="false">http://www.ruisin.net/2008/02/11/a-music-site-example/</guid>
		<description><![CDATA[如标题，我在javaeye.com上面看到的，我觉得应该算是学习开源框架的一个范例程序了。
链接地址如下 http://www.javaeye.com/topic/137793
顺便我把这个范例给上传到了这里：使用Struts2+Spring+Hibernate+sitemesh做的一个在线音乐站点
]]></description>
			<content:encoded><![CDATA[<p>如标题，我在<a href="http://www.javaeye.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.javaeye.com');" title="javaeye.com" target="_blank">javaeye.com</a>上面看到的，我觉得应该算是学习开源框架的一个范例程序了。</p>
<p>链接地址如下 <a href="http://www.javaeye.com/topic/137793" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.javaeye.com');" title="struts2example" target="_blank">http://www.javaeye.com/topic/137793</a></p>
<p>顺便我把这个范例给上传到了这里：<a href="http://www.ruisin.net/wordpress/wp-content/uploads/2008/02/music1.rar"  title="使用Struts2+Spring+Hibernate+sitemesh做的一个在线音乐站点">使用Struts2+Spring+Hibernate+sitemesh做的一个在线音乐站点</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruisin.net/2008/02/11/a-music-site-example/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Spring中进行事务管理</title>
		<link>http://www.ruisin.net/2008/02/11/transaction-declarative-in-spring/</link>
		<comments>http://www.ruisin.net/2008/02/11/transaction-declarative-in-spring/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 06:15:11 +0000</pubDate>
		<dc:creator>Ruisin</dc:creator>
		
		<category><![CDATA[web开发]]></category>

		<category><![CDATA[hibernate]]></category>

		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.ruisin.net/2008/02/11/transaction-declarative-in-spring/</guid>
		<description><![CDATA[声明式事务管理：http://www.redsaga.com/spring_ref/2.0/html/transaction.html#transaction-declarative
只读状态: 只读事务不修改任何数据。只读事务在某些情况下（例如当使用Hibernate时），是一种非常有用的优化。
这是我理解的在我所接触的范围内进行事务管理的主要作用，因为在我看到事物管理的部分的几个小时前还在考虑这个问题。Hibernate的持久化对象会被置于Hibernate的Session缓存之中，并且Session会负责它们在缓存中的唯一性以及与后台数据库数据的同步，只有事务提交后它们才会从缓存中被清除，而且Hibernate会同步对它们的修改。

简单的查询不需要同步，虽然我不知道到底在Hibernate中怎样能够避免这种持久化（我相信Hibernate中肯定是可以的，但是没有详细去查），但是可以在Spring中进行配置。
接下来引用一段参考手册中的声明式配置。
&#60;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&#62;
&#60;beans xmlns=&#8221;http://www.springframework.org/schema/beans&#8221;
xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221;
xmlns:aop=&#8221;http://www.springframework.org/schema/aop&#8221;
xmlns:tx=&#8221;http://www.springframework.org/schema/tx&#8221;
xsi:schemaLocation=&#8221;
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd&#8221;&#62;
&#60;!&#8211; 这是我们将要配置并使它具有事务性的Service对象 &#8211;&#62;
&#60;bean id=&#8221;fooService&#8221; class=&#8221;x.y.service.DefaultFooService&#8221;/&#62;
&#60;!&#8211; the transactional advice (i.e. what &#8216;happens&#8217;; see the &#60;aop:advisor/&#62; bean below) &#8211;&#62;
&#60;tx:advice id=&#8221;txAdvice&#8221; transaction-manager=&#8221;txManager&#8221;&#62;
&#60;!&#8211; the transactional semantics&#8230; &#8211;&#62;
&#60;tx:attributes&#62;
&#60;!&#8211; all methods starting with &#8216;get&#8217; are read-only &#8211;&#62;
&#60;tx:method name=&#8221;get*&#8221; read-only=&#8221;true&#8221;/&#62;
&#60;!&#8211; other methods use the default transaction settings (see below) &#8211;&#62;
&#60;tx:method name=&#8221;*&#8221;/&#62;
&#60;/tx:attributes&#62;
&#60;/tx:advice&#62;
&#60;!&#8211; ensure that the above [...]]]></description>
			<content:encoded><![CDATA[<p>声明式事务管理：<a href="http://www.redsaga.com/spring_ref/2.0/html/transaction.html#transaction-declarative" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.redsaga.com');" title="声明式事务管理" target="_blank">http://www.redsaga.com/spring_ref/2.0/html/transaction.html#transaction-declarative</a></p>
<p><span class="bold"><strong>只读状态</strong></span>: 只读事务不修改任何数据。<strong>只读事务在某些情况下（例如当使用Hibernate时），是一种非常有用的优化。</strong></p>
<p>这是我理解的在我所接触的范围内进行事务管理的主要作用，因为在我看到事物管理的部分的几个小时前还在考虑这个问题。Hibernate的持久化对象会被置于Hibernate的Session缓存之中，并且Session会负责它们在缓存中的唯一性以及与<strong>后台数据库数据的同步，只有事务提交后它们才会从缓存中被清除，而且Hibernate会同步对它们的修改。</strong></p>
<p><span id="more-11"></span></p>
<p>简单的查询不需要同步，虽然我不知道到底在Hibernate中怎样能够避免这种持久化（我相信Hibernate中肯定是可以的，但是没有详细去查），但是可以在Spring中进行配置。</p>
<p>接下来引用一段参考手册中的声明式配置。</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;beans xmlns=&#8221;http://www.springframework.org/schema/beans&#8221;<br />
xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221;<br />
xmlns:aop=&#8221;http://www.springframework.org/schema/aop&#8221;<br />
xmlns:tx=&#8221;http://www.springframework.org/schema/tx&#8221;<br />
xsi:schemaLocation=&#8221;<br />
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd<br />
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd<br />
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd&#8221;&gt;</p>
<p>&lt;!&#8211; 这是我们将要配置并使它具有事务性的Service对象 &#8211;&gt;</p>
<p>&lt;bean id=&#8221;fooService&#8221; class=&#8221;x.y.service.DefaultFooService&#8221;/&gt;</p>
<p>&lt;!&#8211; the transactional advice (i.e. what &#8216;happens&#8217;; see the &lt;aop:advisor/&gt; bean below) &#8211;&gt;</p>
<p>&lt;tx:advice id=&#8221;txAdvice&#8221; transaction-manager=&#8221;txManager&#8221;&gt;<br />
&lt;!&#8211; the transactional semantics&#8230; &#8211;&gt;</p>
<p>&lt;tx:attributes&gt;<br />
&lt;!&#8211; all methods starting with &#8216;get&#8217; are read-only &#8211;&gt;</p>
<p>&lt;tx:method name=&#8221;get*&#8221;<strong> read-only=&#8221;true&#8221;</strong>/&gt;<br />
&lt;!&#8211; other methods use the default transaction settings (see below) &#8211;&gt;</p>
<p>&lt;tx:method name=&#8221;*&#8221;/&gt;<br />
&lt;/tx:attributes&gt;<br />
&lt;/tx:advice&gt;</p>
<p>&lt;!&#8211; ensure that the above transactional advice runs for any execution<br />
of an operation defined by the FooService interface &#8211;&gt;</p>
<p>&lt;aop:config&gt;<br />
&lt;aop:pointcut id=&#8221;fooServiceOperation&#8221; expression=&#8221;execution(* x.y.service.FooService.*(..))&#8221;/&gt;<br />
&lt;aop:advisor advice-ref=&#8221;txAdvice&#8221; pointcut-ref=&#8221;fooServiceOperation&#8221;/&gt;<br />
&lt;/aop:config&gt;</p>
<p>&lt;!&#8211; don&#8217;t forget the DataSource &#8211;&gt;</p>
<p>&lt;bean id=&#8221;dataSource&#8221; class=&#8221;org.apache.commons.dbcp.BasicDataSource&#8221; destroy-method=&#8221;close&#8221;&gt;<br />
&lt;property name=&#8221;driverClassName&#8221; value=&#8221;oracle.jdbc.driver.OracleDriver&#8221;/&gt;<br />
&lt;property name=&#8221;url&#8221; value=&#8221;jdbc:oracle:thin:@rj-t42:1521:elvis&#8221;/&gt;<br />
&lt;property name=&#8221;username&#8221; value=&#8221;scott&#8221;/&gt;<br />
&lt;property name=&#8221;password&#8221; value=&#8221;tiger&#8221;/&gt;<br />
&lt;/bean&gt;</p>
<p>&lt;!&#8211; similarly, don&#8217;t forget the (particular) PlatformTransactionManager &#8211;&gt;</p>
<p>&lt;bean id=&#8221;txManager&#8221; class=&#8221;org.springframework.jdbc.datasource.DataSourceTransactionManager&#8221;&gt;<br />
&lt;property name=&#8221;dataSource&#8221; ref=&#8221;dataSource&#8221;/&gt;<br />
&lt;/bean&gt;</p>
<p>&lt;!&#8211; other &lt;bean/&gt; definitions here &#8211;&gt;</p>
<p>&lt;/beans&gt;</p>
<p>一个普遍性的需求是让整个服务层成为事务性的。满足该需求的最好方式是让切面表达式匹配服务层的所有操作方法。例如：</p>
<p>&lt;aop:config&gt;<br />
&lt;aop:pointcut id=&#8221;fooServiceMethods&#8221; <strong>expression=&#8221;execution(* x.y.service.*.*(..))&#8221;</strong>/&gt;<br />
&lt;aop:advisor advice-ref=&#8221;txAdvice&#8221; pointcut-ref=&#8221;fooServiceMethods&#8221;/&gt;<br />
&lt;/aop:config&gt;</p>
<p>（这个例子中假定你所有的<strong>服务接口</strong>定义在 &#8216;x.y.service&#8217; 包中。你同样可以参考 Chapter 6, 使用Spring进行面向切面编程（AOP） 章获得更详细内容。）</p>
<p>此外，通过在web.xml中配置以下内容，就可以为Spring分开定义配置文件了。</p>
<p>&lt;context-param&gt;<br />
&lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;<br />
&lt;param-value&gt;classpath:applicationContext-*.xml&lt;/param-value&gt;<br />
&lt;/context-param&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruisin.net/2008/02/11/transaction-declarative-in-spring/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Spring中bean的作用域</title>
		<link>http://www.ruisin.net/2008/02/10/bean-scope-in-spring/</link>
		<comments>http://www.ruisin.net/2008/02/10/bean-scope-in-spring/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 02:55:14 +0000</pubDate>
		<dc:creator>Ruisin</dc:creator>
		
		<category><![CDATA[web开发]]></category>

		<category><![CDATA[bean]]></category>

		<category><![CDATA[scope]]></category>

		<category><![CDATA[spirng]]></category>

		<category><![CDATA[struts2]]></category>

		<guid isPermaLink="false">http://www.ruisin.net/2008/02/10/bean-scope-in-spring/</guid>
		<description><![CDATA[前两天按照VeryCD上的一个视频教程去研究Struts2进行CRUD项目开发，一路顺利，但是前两天还是遇到了一个恼火问题，折磨了我很久，今天终于搞定了。

问题描述是这样的：首先在url的参数里我指定了一个错误的数据类型，比如view.action?id=123中id对应的类型为Integer，但是我将参数写作view.action?id=abc，这时页面被Struts2指向了该action的input result。但是当我再将id传递的参数改正回Integer类型后问题就出现了，通过在input result转向的页面上输出#request.id，可以证明正确的只包含数字字符的字符串已经被提交给了服务器，但是输出仍指向input result的页面，并输出Invalid field value for field &#8220;id&#8221;的错误。
经过反复试验，最后的结论是在Spring的配置中出现的错误。在关于action的bean的配置时应该指定属性scope=&#8221;prototype&#8221;。
现将scope属性的描述记录如下：（参考自http://bbs.tarena.com.cn/archiver/?tid-6820.html，针对现在版本做修改）
默认情况下，从bean工厂所取得的实例为singleton
singleton:
Spring容器只存在一个共享的bean实例，默认的配置。
&#60;bean id=&#8221;example&#8221; class=&#8221;com.tarena.bean.Example&#8221;/&#62;
prototype:
每次对bean的请求都会创建一个新的bean实例。
&#60;bean id=&#8221;example&#8221; class=&#8221;com.tarena.bean.Example&#8221; scope=&#8221;prototype&#8221;/&#62;
二者选择的原则：有状态的bean都使用prototype作用域，而对无状态的bean则应该使用singleton作用域。
在Spring2.0中除了以前的Singleton和Prototype外又加入了三个新的web作用域，分别为request、session和global session。
如果你希望容器里的某个bean拥有其中某种新的web作用域，除了在bean级上配置相应的scope属性，还必须在容器级做一个额外的初始化配置。即在web应用的web.xml中增加这么一个ContextListener：
&#60;web-app&#62;
&#60;listener&#62;
&#60;listener-class&#62;org.springframework.web.context.request.RequestContextListener&#60;/listener-class&#62;
&#60;/listener&#62;
&#60;/web-app&#62;
以上是针对Servlet 2.4以后的版本。
比如Request作用域：
&#60;bean id=&#8221;loginAction&#8221; class=&#8221;com.tarena.LoginAction&#8221; scope=&#8221;request&#8221;/&#62;
]]></description>
			<content:encoded><![CDATA[<p>前两天按照<a href="http://www.verycd.com/topics/111480/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.verycd.com');" title="WebWork + Spring + Hibernate整合开发网络书城视频演示" target="_blank">VeryCD上的一个视频教程</a>去研究Struts2进行CRUD项目开发，一路顺利，但是前两天还是遇到了一个恼火问题，折磨了我很久，今天终于搞定了。</p>
<p><span id="more-10"></span></p>
<p>问题描述是这样的：首先在url的参数里我指定了一个错误的数据类型，比如view.action?id=123中id对应的类型为Integer，但是我将参数写作view.action?id=abc，这时页面被Struts2指向了该action的input result。但是当我再将id传递的参数改正回Integer类型后问题就出现了，通过在input result转向的页面上输出#request.id，可以证明正确的只包含数字字符的字符串已经被提交给了服务器，但是输出仍指向input result的页面，并输出<span class="errorMessage">Invalid field value for field &#8220;id&#8221;的错误。</span></p>
<p>经过反复试验，最后的结论是在Spring的配置中出现的错误。在关于action的bean的配置时应该指定属性scope=&#8221;prototype&#8221;。</p>
<p>现将scope属性的描述记录如下：（参考自<a href="http://bbs.tarena.com.cn/archiver/?tid-6820.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/bbs.tarena.com.cn');" title="SPRING中属性SCOPE的prototype是什么意思" target="_blank">http://bbs.tarena.com.cn/archiver/?tid-6820.html</a>，针对现在版本做修改）</p>
<p>默认情况下，从bean工厂所取得的实例为singleton</p>
<p><strong>singleton:</strong><br />
Spring容器只存在一个<strong>共享的bean实例</strong>，默认的配置。<br />
&lt;bean id=&#8221;example&#8221; class=&#8221;com.tarena.bean.Example&#8221;/&gt;</p>
<p><strong>prototype:</strong><br />
每次对bean的请求都会<strong>创建一个新的bean实例</strong>。<br />
&lt;bean id=&#8221;example&#8221; class=&#8221;com.tarena.bean.Example&#8221; scope=&#8221;prototype&#8221;/&gt;<br />
二者选择的原则：有状态的bean都使用prototype作用域，而对无状态的bean则应该使用singleton作用域。</p>
<p>在Spring2.0中除了以前的Singleton和Prototype外又加入了三个新的web作用域，分别为request、session和global session。<br />
如果你希望容器里的某个bean拥有其中某种新的web作用域，除了在bean级上配置相应的scope属性，还必须在容器级做一个额外的初始化配置。即在web应用的web.xml中增加这么一个ContextListener：<br />
&lt;web-app&gt;<br />
&lt;listener&gt;<br />
&lt;listener-class&gt;org.springframework.web.context.request.RequestContextListener&lt;/listener-class&gt;<br />
&lt;/listener&gt;<br />
&lt;/web-app&gt;<br />
以上是针对Servlet 2.4以后的版本。<br />
比如Request作用域：<br />
&lt;bean id=&#8221;loginAction&#8221; class=&#8221;com.tarena.LoginAction&#8221; scope=&#8221;request&#8221;/&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruisin.net/2008/02/10/bean-scope-in-spring/feed/</wfw:commentRss>
		</item>
		<item>
		<title>在MyEclipse平台下创建Struts2, Spring和Hibernate项目的基本结构</title>
		<link>http://www.ruisin.net/2008/02/08/building-struts2-plantform-in-myeclipse/</link>
		<comments>http://www.ruisin.net/2008/02/08/building-struts2-plantform-in-myeclipse/#comments</comments>
		<pubDate>Fri, 08 Feb 2008 04:04:42 +0000</pubDate>
		<dc:creator>Ruisin</dc:creator>
		
		<category><![CDATA[web开发]]></category>

		<category><![CDATA[spring]]></category>

		<category><![CDATA[struts2]]></category>

		<guid isPermaLink="false">http://www.ruisin.net/2008/02/08/building-struts2-plantform-in-myeclipse/</guid>
		<description><![CDATA[一些基本配置的备忘，以后还会在其他文件中继续添加CRUD操作的内容]]></description>
			<content:encoded><![CDATA[<p><strong>1.一些包的说明</strong></p>
<p>本项目构建的基础是MyEclipse 6尚未提供Struts2的支持，所以Struts2的相关部分需要手工添加。Spring和Hibernate部分不再说明。</p>
<p>以下包为Struts2的基础包，可以在Struts2的blank实例中找到。</p>
<ul>
<li>commons-logging</li>
<li>freemarker</li>
<li>ognl</li>
<li>struts2-core</li>
<li>xwork</li>
</ul>
<p><span id="more-9"></span>请注意这个包在Struts2的项目中，是可选的，如果添加了则不必再包含struts.properties文件。具体原因可参见《<a href="http://java.ccidnet.com/art/3565/20070910/1206875_1.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/java.ccidnet.com');" target="_blank" title="在Struts2中集成Spring详细讲解">在Struts2中集成Spring详细讲解</a>》一文。</p>
<ul>
<li>struts2-spring-plugin</li>
</ul>
<p>这个包提供spring的支持，可以在Spring的<a href="http://www.springframework.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.springframework.org');" target="_blank" title="Spring">网站</a>上下载，MyEclipse好像没有包含哦~</p>
<ul>
<li>spring</li>
</ul>
<p>这两个包需要在<a href="http://commons.apache.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/commons.apache.org');" target="_blank" title="Commons">commons项目的网站</a>里面找，前一个包依赖后一个包。说实话，我不知道这两个包是否有其他替代方案，但是我构建出的SSH项目确实需要这两个包才能通过编译。</p>
<ul>
<li>commons-dbcp</li>
<li>commons-pool</li>
</ul>
<p><strong>2.目录结构</strong></p>
<p>在项目路径下可以建立如下结构的目录</p>
<ul>
<li>.vo - 即POJO类（接口部分）</li>
<li>.vo.impl - POJO类的实现</li>
<li>.dao - DAO的接口</li>
<li>.dao.impl - DAO的实现</li>
<li>.service - 作为DAO与action的隔离层</li>
<li>.action - Struts2的action</li>
<li>.model - 模型类，如网络商店的购物车模型</li>
<li>.util - 其他工具类</li>
</ul>
<p><strong>3.一些文件的基础写作</strong></p>
<p><strong>struts.xml - 位于/WEB-INF/class/</strong></p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243; ?&gt;<br />
&lt;!DOCTYPE struts PUBLIC &#8220;-//Apache Software Foundation//DTD Struts Configuration 2.0//EN&#8221; &#8220;http://struts.apache.org/dtds/struts-2.0.dtd&#8221;&gt;<br />
&lt;struts&gt;<br />
&lt;include file=&#8221;struts-default.xml&#8221; /&gt;<br />
&lt;package name=&#8221;example&#8221; extends=&#8221;struts-default&#8221;&gt;</p>
<p>&lt;action name=&#8221;HelloWorld&#8221; class=&#8221;example.HelloWorld&#8221;&gt;<br />
&lt;result&gt;/example/HelloWorld.jsp&lt;/result&gt;<br />
&lt;/action&gt;</p>
<p>&lt;action name=&#8221;Login_*&#8221; method=&#8221;{1}&#8221; class=&#8221;example.Login&#8221;&gt;<br />
&lt;result name=&#8221;input&#8221;&gt;/example/Login.jsp&lt;/result&gt;<br />
&lt;result type=&#8221;redirect-action&#8221;&gt;Menu&lt;/result&gt;<br />
&lt;/action&gt;</p>
<p>&lt;action name=&#8221;*&#8221; class=&#8221;example.ExampleSupport&#8221;&gt;<br />
&lt;result&gt;/example/{1}.jsp&lt;/result&gt;<br />
&lt;/action&gt;</p>
<p>&lt;!&#8211; Add actions here &#8211;&gt;</p>
<p>&lt;/package&gt;<br />
&lt;/struts&gt;</p>
<p><strong>web.xml - 位于/WEB-INF/</strong></p>
<p>需加入以下过滤器</p>
<p>&lt;filter&gt;<br />
&lt;filter-name&gt;struts2&lt;/filter-name&gt;<br />
&lt;filter-class&gt;<br />
org.apache.struts2.dispatcher.FilterDispatcher<br />
&lt;/filter-class&gt;<br />
&lt;/filter&gt;</p>
<p>&lt;filter-mapping&gt;<br />
&lt;filter-name&gt;struts2&lt;/filter-name&gt;<br />
&lt;url-pattern&gt;/*&lt;/url-pattern&gt;<br />
&lt;/filter-mapping&gt;</p>
<p>如若还需要用到Spring，则还需加入以下部分</p>
<p>&lt;listener&gt;<br />
&lt;listener-class&gt;<br />
org.springframework.web.context.ContextLoaderListener<br />
&lt;/listener-class&gt;<br />
&lt;/listener&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruisin.net/2008/02/08/building-struts2-plantform-in-myeclipse/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
