<?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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>华水 &#187; Struts</title>
	<atom:link href="http://huashui.org/tag/struts/feed" rel="self" type="application/rss+xml" />
	<link>http://huashui.org</link>
	<description>总是到下雨才想到雨伞，总是到拿雨伞时才发现不见了。</description>
	<lastBuildDate>Thu, 29 Jul 2010 09:53:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>struts2的action中获得request response session 对象</title>
		<link>http://huashui.org/post/struts2-action-request-response-session.html</link>
		<comments>http://huashui.org/post/struts2-action-request-response-session.html#comments</comments>
		<pubDate>Wed, 03 Mar 2010 01:17:08 +0000</pubDate>
		<dc:creator>Huashui</dc:creator>
				<category><![CDATA[Struts]]></category>
		<category><![CDATA[ActionContext]]></category>
		<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Struts2]]></category>

		<guid isPermaLink="false">http://huashui.org/?p=324</guid>
		<description><![CDATA[在struts2中有两种方式可以得到这些对象,一般有两种方式，一种是利用Ioc实现拦截器接口，一种是使用静态类。分布如下 第一种方式，非IoC方式，使用ActionContext类和ServletActionContext类，例如 HttpServletResponse response&#40;HttpServletResponse&#41; = ActionContext.getContext&#40;&#41;.get&#40;org.apache.struts2.StrutsStatics.HTTP_RESPONSE&#41;; HttpServletRequest request&#40;HttpServletRequest&#41; = &#125; ActionContext.getContext&#40;&#41;.get&#40;org.apache.struts2.StrutsStatics.HTTP_REQUEST&#41;; HttpServletResponse response = ServletActionContext.getResponse&#40;&#41; response.getWriter&#40;&#41;.write&#40;&#34;hello world&#34;&#41;; 第二种就是使用Ioc的方式，实现ServletResponseAware、ServletRequestAware、SessionAware和CookiesAware等接口。例子如下 import com.opensymphony.xwork2.ActionSupport; import javax.servlet.http.*; import org.apache.struts2.interceptor.*; &#160; public class MyAction extends ActionSupport implements ServletResponseAware&#123; private javax.servlet.http.HttpServletResponse response; // 获得HttpServletResponse对象 public void setServletResponse&#40;HttpServletResponse response&#41;&#123; this.response = response; &#125; public String execute&#40;&#41; throws Exception &#123; response.getWriter&#40;&#41;.write&#40;&#34;实现ServletResponseAware接口&#34;&#41;; &#125; import java.util.Map; [...]]]></description>
		<wfw:commentRss>http://huashui.org/post/struts2-action-request-response-session.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Struts 2注解实例二</title>
		<link>http://huashui.org/post/struts-2-annotations-example-1.html</link>
		<comments>http://huashui.org/post/struts-2-annotations-example-1.html#comments</comments>
		<pubDate>Thu, 25 Feb 2010 07:53:28 +0000</pubDate>
		<dc:creator>Huashui</dc:creator>
				<category><![CDATA[Struts]]></category>
		<category><![CDATA[Annotations]]></category>
		<category><![CDATA[注解]]></category>

		<guid isPermaLink="false">http://huashui.org/?p=303</guid>
		<description><![CDATA[这个例子将继续前面讲的例子 Here we will see the same hello user example with the following changes. Our Action class ends with the world Action and does not implement com.opensymphony.xwork2.Action. We use /results directory for storing our result pages instead of WEB-INF/content. 和上个例子对比，我们做了如下变更， Action类以Action结尾，同时不实现com.opensymphony.xwork2.Action接口 我们使用/results目录为存放我们的result页面，而不再放在WEB-INF/content目录. The directory structure of the hello user example is shown below. 目录的结构如下 Our [...]]]></description>
		<wfw:commentRss>http://huashui.org/post/struts-2-annotations-example-1.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Struts 2注解实例一</title>
		<link>http://huashui.org/post/struts-2-annotations-example.html</link>
		<comments>http://huashui.org/post/struts-2-annotations-example.html#comments</comments>
		<pubDate>Thu, 25 Feb 2010 07:13:15 +0000</pubDate>
		<dc:creator>Huashui</dc:creator>
				<category><![CDATA[Struts]]></category>
		<category><![CDATA[Annotations]]></category>
		<category><![CDATA[注解]]></category>

		<guid isPermaLink="false">http://huashui.org/?p=277</guid>
		<description><![CDATA[本文将通过一个前台通过表单输入user，来实现hello user的方式来讲述Struts2中使用注解。 首先要引入以下jar包 commons-fileupload-1.2.1 commons-io-1.3.2 commons-logging-1.1 freemarker-2.3.13 junit-3.8.1 onl-2.6.11 spring-test-2.5.6 struts2-convention-plugin-2.1.6 struts2-core-2.1.6 xwork-2.1.2 首先要确定一下版本是否正确，此外struts2-convention-plugin-2.1.6 是必须加入的，这个包是用来注解的核心包。 目录的结构如下： 接下来书写表单输入页面 &#60;%@ page language=&#34;java&#34; contentType=&#34;text/html; charset=ISO-8859-1&#34; pageEncoding=&#34;ISO-8859-1&#34;%&#62; &#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD HTML 4.01 Transitional//EN&#34; &#34;http://www.w3.org/TR/html4/loose.dtd&#34;&#62; &#60;%@taglib uri=&#34;/struts-tags&#34; prefix=&#34;s&#34; %&#62; &#60;html&#62; &#60;head&#62; &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=UTF-8&#34;&#62; &#60;title&#62;Hello World&#60;/title&#62; &#60;/head&#62; &#60;body&#62; &#60;s:form action=&#34;welcome-user&#34; &#62; &#60;s:textfield name=&#34;userName&#34; label=&#34;User Name&#34; /&#62; &#60;s:submit /&#62; [...]]]></description>
		<wfw:commentRss>http://huashui.org/post/struts-2-annotations-example.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>在struts2.1中使用注解和拦截器实现权限细粒度控制</title>
		<link>http://huashui.org/post/struts2-1-annotations-interceptor-authentication.html</link>
		<comments>http://huashui.org/post/struts2-1-annotations-interceptor-authentication.html#comments</comments>
		<pubDate>Sun, 07 Feb 2010 04:27:10 +0000</pubDate>
		<dc:creator>Huashui</dc:creator>
				<category><![CDATA[Struts]]></category>
		<category><![CDATA[Annotations]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[Interceptor]]></category>

		<guid isPermaLink="false">http://huashui.org/?p=227</guid>
		<description><![CDATA[正如上一篇文章说的，拦截器是struts2的核心，同时struts2引入了注解的方式。这里就来简单看看针对struts2.1中使用注解和拦截器的开发。 首先要引入struts2.1各包，特别要引入Convention Plugin插件。 本文只是一个简单模拟，因此我们新建两个jsp文件，分别为登录和退出。 login.jsp &#60;%@ page language=&#34;java&#34; pageEncoding=&#34;GB18030&#34;%&#62; &#160; &#60;% pageContext.getSession&#40;&#41;.setAttribute&#40;&#34;user&#34;,&#34;huashui&#34;&#41;; pageContext.getSession&#40;&#41;.setAttribute&#40;&#34;rights&#34;,&#34;TEST_AUTH&#34;&#41;; %&#62; 登录成功 logout.jsp &#60;%@ page language=&#34;java&#34; pageEncoding=&#34;GB18030&#34;%&#62; &#160; &#60;% pageContext.getSession&#40;&#41;.removeAttribute&#40;&#34;user&#34;&#41;; pageContext.getSession&#40;&#41;.removeAttribute&#40;&#34;rights&#34;&#41;; %&#62; 退出成功 index.jsp &#60;%@ page language=&#34;java&#34; pageEncoding=&#34;GB18030&#34;%&#62; &#60;!DOCTYPE HTML PUBLIC &#34;-//W3C//DTD HTML 4.01 Transitional//EN&#34;&#62; &#60;html&#62; &#60;head&#62; &#60;title&#62;主页&#60;/title&#62; &#60;/head&#62; &#60;body&#62; &#60;p&#62; $&#123;tip &#125; &#60;/p&#62; &#60;a href=&#34;login.jsp&#34;&#62;登录&#60;/a&#62; &#60;br /&#62; &#60;a href=&#34;logout.jsp&#34;&#62;退出&#60;/a&#62; &#60;br /&#62; [...]]]></description>
		<wfw:commentRss>http://huashui.org/post/struts2-1-annotations-interceptor-authentication.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Struts2的教程资源下载汇总</title>
		<link>http://huashui.org/post/struts2-resources-study.html</link>
		<comments>http://huashui.org/post/struts2-resources-study.html#comments</comments>
		<pubDate>Sat, 06 Feb 2010 02:20:01 +0000</pubDate>
		<dc:creator>Huashui</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Struts]]></category>

		<guid isPermaLink="false">http://huashui.org/?p=217</guid>
		<description><![CDATA[目前，国内的java培训貌似很热，这应该和国内的环境有关系。特别是随着电子商务的发展，越来越多的平台都转换到java的平台上来进行开发建设。 原来自己一直使用Struts1，虽然很早知道Struts2出来了，但是一直没时间去看。最近花了点时间看下，感觉确实比Struts1.x好得多。个人感觉有以下几点 1、可以开始使用注解，使用注解的方式一直是我最喜欢的开发方式。虽然从软件开发的理念来讲耦合性太强，但是，即使基于xml配置，基本上很少说可以只更改xml而不更改代码的。一样要更改代码，一样要进行重新编译。使用注解使用起来很清晰明了。挺合我胃口，当然仁者见仁智者见智，关键是习惯。 2、不用去写actionForm。这个直接在Action里面进行控制。这个非常不错。 3、引入拦截器，这个以后在权限控制上就更轻松了。 目前，网上资源很多，有兴趣有时间可以去看看，以下是我找到的一些资源汇总。不够我感觉最好的资源还是在Struts的官网上，如果英文相对比较好，可以去看看。 http://struts.apache.org 传智播客 黎活明老师（强烈推荐，我特别喜欢他讲的课程） http://www.verycd.com/topics/2787345/ 浪曦 J2EE Struts 2应用开发详解系列视频 (转换器将得特别详细，但是课程不全) http://www.verycd.com/topics/210454/ 张冰Struts视频教程，各重点都有讲到 http://www.verycd.com/topics/280507/ 银河老师的文本教程，比较简单，入门 http://www.blogjava.net/nokiaguy/archive/2008/04/15/193229.html Related Posts2010-03-03 -- struts2的action中获得request response session 对象2010-03-03 -- Json工具类2010-03-01 -- jsp中文验证码2010-03-01 -- 改变Eclipse默认编码2010-02-25 -- Struts 2注解实例二2010-02-25 -- Struts 2注解实例一2010-02-09 -- 使用Properties文件来对Log4j进行配置2010-02-08 -- 简单的Log4j配置2010-02-07 -- 使用PHPRpc实现Java和PHP通信2010-02-07 -- 在struts2.1中使用注解和拦截器实现权限细粒度控制]]></description>
		<wfw:commentRss>http://huashui.org/post/struts2-resources-study.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
