<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
  <channel>
    <title>esffor</title>
    <description>   本blog部分文章转自另一位技术达人，只以收藏为目的。原文出自：http://blog.csdn.net/daryl715/。
  特此说明！</description>
    <link>http://esffor.javaeye.com</link>
    <language>UTF-8</language>
    <copyright>Copyright 2003-2008, JavaEye.com</copyright>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <generator>JavaEye - 做最棒的软件开发交流社区</generator>
      <item>
        <title>同样的任务，不同的结局</title>
        <author>esffor</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://esffor.javaeye.com">esffor</a>&nbsp;
          链接：<a href="http://esffor.javaeye.com/blog/168169" style="color:red;">http://esffor.javaeye.com/blog/168169</a>&nbsp;
          发表时间: 2008年02月29日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <img src="http://p.blog.csdn.net/images/p_blog_csdn_net/daryl715/未命名.jpg" alt="" />&nbsp;
          <br/>
          <span style="color:red;">
            <a href="http://esffor.javaeye.com/blog/168169#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/92' target='_blank'><span style="color:red;font-weight:bold;">快来参加7月17日在成都举行的SOA中国技术论坛</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/106' target='_blank'><span style="color:blue;font-weight:bold;">JavaEye问答大赛开始了！ 从6月23日 至 7月6日，奖品丰厚 ！</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Fri, 29 Feb 2008 17:26:57 +0800</pubDate>
        <link>http://esffor.javaeye.com/blog/168169</link>
        <guid>http://esffor.javaeye.com/blog/168169</guid>
      </item>
      <item>
        <title>常用javascript客户端正则输入校验代码</title>
        <author>esffor</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://esffor.javaeye.com">esffor</a>&nbsp;
          链接：<a href="http://esffor.javaeye.com/blog/168170" style="color:red;">http://esffor.javaeye.com/blog/168170</a>&nbsp;
          发表时间: 2008年02月29日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p>&nbsp;</p><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: 95%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"><div><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><span style="COLOR: #000000">去前后空格<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />function&nbsp;trim(s)<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;s.replace(&nbsp;/^s*/,&nbsp;&quot;&quot;&nbsp;).replace(&nbsp;/s*$/,&nbsp;&quot;&quot;&nbsp;);<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;}&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />if&nbsp;(!/^w{4,25}$/.test(username))<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;errStr&nbsp;+=&nbsp;&quot; 您的用户名必须是字母和数字，且长度在4到25之间&quot;;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />}<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />if&nbsp;(!/^w{4,25}$/.test(pass))<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;errStr&nbsp;+=&nbsp;&quot; 您的密码必须是字母和数字，且长度在4到25之间&quot;;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />}<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />if&nbsp;(!/^[0-1]?[0-9]?[0-9]$/.test(age))<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;errStr&nbsp;+=&nbsp;&quot; 您的年龄必须为整数，且必须是一个有效的年龄值&quot;;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />}<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />if(!/^19dd-[0-1]d-[0-3]d$/.test(birth)&nbsp;&amp;&amp;&nbsp;!/^20[0-1]d-[0-1]d-[0-3]d$/.test(birth))<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;errStr&nbsp;+=&nbsp;&quot; 您的生日格式不正确,格式：yyyy-MM-DD&quot;;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />}<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span></div></div>
          <br/>
          <span style="color:red;">
            <a href="http://esffor.javaeye.com/blog/168170#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/106' target='_blank'><span style="color:blue;font-weight:bold;">JavaEye问答大赛开始了！ 从6月23日 至 7月6日，奖品丰厚 ！</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/92' target='_blank'><span style="color:red;font-weight:bold;">快来参加7月17日在成都举行的SOA中国技术论坛</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Fri, 29 Feb 2008 16:43:44 +0800</pubDate>
        <link>http://esffor.javaeye.com/blog/168170</link>
        <guid>http://esffor.javaeye.com/blog/168170</guid>
      </item>
      <item>
        <title>《struts2权威指南》学习笔记之使用拦截器完成权限控制</title>
        <author>esffor</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://esffor.javaeye.com">esffor</a>&nbsp;
          链接：<a href="http://esffor.javaeye.com/blog/168172" style="color:red;">http://esffor.javaeye.com/blog/168172</a>&nbsp;
          发表时间: 2008年02月29日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p>本例的功能是，必须指定用户名&nbsp;scott/tiger 登陆的用户，方能查看系统中viewBook的这个资源，否则直接跳回登陆页面</p><p>登陆Action</p><p>&nbsp;</p><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: 95%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"><div><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><span style="COLOR: #0000ff">package</span><span style="COLOR: #000000">&nbsp;auth;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;com.opensymphony.xwork2.ActionSupport;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;com.opensymphony.xwork2.ActionContext;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;java.util.</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;LoginAction&nbsp;</span><span style="COLOR: #0000ff">extends</span><span style="COLOR: #000000">&nbsp;ActionSupport<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" id="_177_971_Open_Image" onclick="this.style.display='none'; document.getElementById('_177_971_Open_Text').style.display='none'; document.getElementById('_177_971_Closed_Image').style.display='inline'; document.getElementById('_177_971_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" id="_177_971_Closed_Image" onclick="this.style.display='none'; document.getElementById('_177_971_Closed_Text').style.display='none'; document.getElementById('_177_971_Open_Image').style.display='inline'; document.getElementById('_177_971_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" /></span><span id="_177_971_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">...</span><span id="_177_971_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">&nbsp;String&nbsp;username;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">&nbsp;String&nbsp;password;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;setUsername(String&nbsp;username)<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_284_324_Open_Image" onclick="this.style.display='none'; document.getElementById('_284_324_Open_Text').style.display='none'; document.getElementById('_284_324_Closed_Image').style.display='inline'; document.getElementById('_284_324_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_284_324_Closed_Image" onclick="this.style.display='none'; document.getElementById('_284_324_Closed_Text').style.display='none'; document.getElementById('_284_324_Open_Image').style.display='inline'; document.getElementById('_284_324_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="_284_324_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">...</span><span id="_284_324_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">.username&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;username;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;String&nbsp;getUsername()<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_359_390_Open_Image" onclick="this.style.display='none'; document.getElementById('_359_390_Open_Text').style.display='none'; document.getElementById('_359_390_Closed_Image').style.display='inline'; document.getElementById('_359_390_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_359_390_Closed_Image" onclick="this.style.display='none'; document.getElementById('_359_390_Closed_Text').style.display='none'; document.getElementById('_359_390_Open_Image').style.display='inline'; document.getElementById('_359_390_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="_359_390_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">...</span><span id="_359_390_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;username;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;setPassword(String&nbsp;password)<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_439_479_Open_Image" onclick="this.style.display='none'; document.getElementById('_439_479_Open_Text').style.display='none'; document.getElementById('_439_479_Closed_Image').style.display='inline'; document.getElementById('_439_479_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_439_479_Closed_Image" onclick="this.style.display='none'; document.getElementById('_439_479_Closed_Text').style.display='none'; document.getElementById('_439_479_Open_Image').style.display='inline'; document.getElementById('_439_479_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="_439_479_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">...</span><span id="_439_479_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">.password&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;password;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;String&nbsp;getPassword()<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_514_545_Open_Image" onclick="this.style.display='none'; document.getElementById('_514_545_Open_Text').style.display='none'; document.getElementById('_514_545_Closed_Image').style.display='inline'; document.getElementById('_514_545_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_514_545_Closed_Image" onclick="this.style.display='none'; document.getElementById('_514_545_Closed_Text').style.display='none'; document.getElementById('_514_545_Open_Image').style.display='inline'; document.getElementById('_514_545_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="_514_545_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">...</span><span id="_514_545_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;password;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;String&nbsp;execute()&nbsp;</span><span style="COLOR: #0000ff">throws</span><span style="COLOR: #000000">&nbsp;Exception<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_594_967_Open_Image" onclick="this.style.display='none'; document.getElementById('_594_967_Open_Text').style.display='none'; document.getElementById('_594_967_Closed_Image').style.display='inline'; document.getElementById('_594_967_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_594_967_Closed_Image" onclick="this.style.display='none'; document.getElementById('_594_967_Closed_Text').style.display='none'; document.getElementById('_594_967_Open_Image').style.display='inline'; document.getElementById('_594_967_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="_594_967_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">...</span><span id="_594_967_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">进入execute方法执行体..........</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">);<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thread.sleep(</span><span style="COLOR: #000000">1500</span><span style="COLOR: #000000">);<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(getUsername().equals(</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">scott</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">)<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">&amp;&amp;</span><span style="COLOR: #000000">&nbsp;getPassword().equals(</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">tiger</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">)&nbsp;)<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_750_914_Open_Image" onclick="this.style.display='none'; document.getElementById('_750_914_Open_Text').style.display='none'; document.getElementById('_750_914_Closed_Image').style.display='inline'; document.getElementById('_750_914_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_750_914_Closed_Image" onclick="this.style.display='none'; document.getElementById('_750_914_Closed_Text').style.display='none'; document.getElementById('_750_914_Open_Image').style.display='inline'; document.getElementById('_750_914_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="_750_914_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">...</span><span id="_750_914_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ActionContext&nbsp;ctx&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;ActionContext.getContext();<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map&nbsp;session&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;ctx.getSession();<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;session.put(</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">user</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">&nbsp;,&nbsp;getUsername());<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;SUCCESS;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_925_961_Open_Image" onclick="this.style.display='none'; document.getElementById('_925_961_Open_Text').style.display='none'; document.getElementById('_925_961_Closed_Image').style.display='inline'; document.getElementById('_925_961_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_925_961_Closed_Image" onclick="this.style.display='none'; document.getElementById('_925_961_Closed_Text').style.display='none'; document.getElementById('_925_961_Open_Image').style.display='inline'; document.getElementById('_925_961_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="_925_961_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">...</span><span id="_925_961_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;ERROR;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span></div></div><p>&nbsp;权限检测拦截器</p><p>&nbsp;</p><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: 95%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"><div><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><span style="COLOR: #0000ff">package</span><span style="COLOR: #000000">&nbsp;auth;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;java.util.Map;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;com.opensymphony.xwork2.Action;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;com.opensymphony.xwork2.ActionContext;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;com.opensymphony.xwork2.ActionInvocation;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;com.opensymphony.xwork2.interceptor.AbstractInterceptor;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" id="_299_651_Open_Image" onclick="this.style.display='none'; document.getElementById('_299_651_Open_Text').style.display='none'; document.getElementById('_299_651_Closed_Image').style.display='inline'; document.getElementById('_299_651_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" id="_299_651_Closed_Image" onclick="this.style.display='none'; document.getElementById('_299_651_Closed_Text').style.display='none'; document.getElementById('_299_651_Open_Image').style.display='inline'; document.getElementById('_299_651_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;AuthorityInterceptor&nbsp;</span><span style="COLOR: #0000ff">extends</span><span style="COLOR: #000000">&nbsp;AbstractInterceptor&nbsp;</span><span id="_299_651_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">...</span><span id="_299_651_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_375_648_Open_Image" onclick="this.style.display='none'; document.getElementById('_375_648_Open_Text').style.display='none'; document.getElementById('_375_648_Closed_Image').style.display='inline'; document.getElementById('_375_648_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_375_648_Closed_Image" onclick="this.style.display='none'; document.getElementById('_375_648_Closed_Text').style.display='none'; document.getElementById('_375_648_Open_Image').style.display='inline'; document.getElementById('_375_648_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;String&nbsp;intercept(ActionInvocation&nbsp;invocation)&nbsp;</span><span style="COLOR: #0000ff">throws</span><span style="COLOR: #000000">&nbsp;Exception&nbsp;</span><span id="_375_648_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">...</span><span id="_375_648_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ActionContext&nbsp;ctx</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">invocation.getInvocationContext();<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map&nbsp;session</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">ctx.getSession();<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;user</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">(String)session.get(</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">user</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">);<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_545_580_Open_Image" onclick="this.style.display='none'; document.getElementById('_545_580_Open_Text').style.display='none'; document.getElementById('_545_580_Closed_Image').style.display='inline'; document.getElementById('_545_580_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_545_580_Closed_Image" onclick="this.style.display='none'; document.getElementById('_545_580_Closed_Text').style.display='none'; document.getElementById('_545_580_Open_Image').style.display='inline'; document.getElementById('_545_580_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(user</span><span style="COLOR: #000000">!=</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">&amp;&amp;</span><span style="COLOR: #000000">user.equals(</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">scott</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">))</span><span id="_545_580_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">...</span><span id="_545_580_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;invocation.invoke();<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_585_642_Open_Image" onclick="this.style.display='none'; document.getElementById('_585_642_Open_Text').style.display='none'; document.getElementById('_585_642_Closed_Image').style.display='inline'; document.getElementById('_585_642_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_585_642_Closed_Image" onclick="this.style.display='none'; document.getElementById('_585_642_Closed_Text').style.display='none'; document.getElementById('_585_642_Open_Image').style.display='inline'; document.getElementById('_585_642_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #0000ff">else</span><span id="_585_642_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">...</span><span id="_585_642_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ctx.put(</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">tip</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">您还没有登录</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">);<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;Action.LOGIN;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span></div></div><p>&nbsp;</p><p>配置action (struts.xml)</p><p>&nbsp;</p><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: 95%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"><div><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><span style="COLOR: #0000ff">&lt;?</span><span style="COLOR: #ff00ff">xml&nbsp;version=&quot;1.0&quot;&nbsp;encoding=&quot;GBK&quot;</span><span style="COLOR: #0000ff">?&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">&lt;!</span><span style="COLOR: #ff00ff">DOCTYPE&nbsp;struts&nbsp;PUBLIC<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;-//Apache&nbsp;Software&nbsp;Foundation//DTD&nbsp;Struts&nbsp;Configuration&nbsp;2.0//EN&quot;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;http://struts.apache.org/dtds/struts-2.0.dtd&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">struts</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">constant&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;struts.custom.i18n.resources&quot;</span><span style="COLOR: #ff0000">&nbsp;value</span><span style="COLOR: #0000ff">=&quot;globalMessages&quot;</span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">constant&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;struts.i18n.encoding&quot;</span><span style="COLOR: #ff0000">&nbsp;value</span><span style="COLOR: #0000ff">=&quot;GBK&quot;</span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">package&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;lee&quot;</span><span style="COLOR: #ff0000">&nbsp;extends</span><span style="COLOR: #0000ff">=&quot;struts-default&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">interceptors</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">interceptor&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;authority&quot;</span><span style="COLOR: #ff0000">&nbsp;class</span><span style="COLOR: #0000ff">=&quot;auth.AuthorityInterceptor&quot;</span><span style="COLOR: #0000ff">&gt;&lt;/</span><span style="COLOR: #800000">interceptor</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">interceptors</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">global-results</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">result&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;login&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">/login.jsp</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">result</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">global-results</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">&lt;!--</span><span style="COLOR: #008000">&nbsp;将viewBook.jsp放在web-inf下，防止直接用url访问&nbsp;</span><span style="COLOR: #008000">--&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">action&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;viewBook&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">result</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">/WEB-INF/viewBook.jsp</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">result</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">&lt;!--</span><span style="COLOR: #008000">&nbsp;拦截器一般配置在result之后&nbsp;</span><span style="COLOR: #008000">--&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">interceptor-ref&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;defaultStack&quot;</span><span style="COLOR: #0000ff">&gt;&lt;/</span><span style="COLOR: #800000">interceptor-ref</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">interceptor-ref&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;authority&quot;</span><span style="COLOR: #0000ff">&gt;&lt;/</span><span style="COLOR: #800000">interceptor-ref</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">&nbsp;&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">action</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">action&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;login&quot;</span><span style="COLOR: #ff0000">&nbsp;class</span><span style="COLOR: #0000ff">=&quot;auth.LoginAction&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">result&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;error&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">/error.jsp</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">result</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">result&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;success&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">/welcome.jsp</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">result</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">action</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">package</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">struts</span><span style="COLOR: #0000ff">&gt;</span></div></div><p>&nbsp;</p><p>web.xml</p><p>&nbsp;</p><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: 95%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"><div><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><span style="COLOR: #0000ff">&lt;?</span><span style="COLOR: #ff00ff">xml&nbsp;version=&quot;1.0&quot;&nbsp;encoding=&quot;UTF-8&quot;</span><span style="COLOR: #0000ff">?&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">web-app&nbsp;</span><span style="COLOR: #ff0000">version</span><span style="COLOR: #0000ff">=&quot;2.5&quot;</span><span style="COLOR: #ff0000">&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;xmlns</span><span style="COLOR: #0000ff">=&quot;http://java.sun.com/xml/ns/javaee&quot;</span><span style="COLOR: #ff0000">&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;xmlns:xsi</span><span style="COLOR: #0000ff">=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span><span style="COLOR: #ff0000">&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;xsi:schemaLocation</span><span style="COLOR: #0000ff">=&quot;http://java.sun.com/xml/ns/javaee&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter-name</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">struts2</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter-name</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter-class</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">org.apache.struts2.dispatcher.FilterDispatcher</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter-class</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter-mapping</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter-name</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">struts2</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter-name</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">url-pattern</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">/*</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">url-pattern</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter-mapping</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter-name</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">struts-cleanup</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter-name</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter-class</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">org.apache.struts2.dispatcher.ActionContextCleanUp</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter-class</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter-mapping</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter-name</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">struts-cleanup</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter-name</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">url-pattern</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">/*</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">url-pattern</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter-mapping</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">web-app</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span></div></div><p>&nbsp;</p><p>viewBook.jsp&nbsp; 放到web-inf下</p><p>&nbsp;</p><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: 95%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"><div><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" id="_2_44_Open_Image" onclick="this.style.display='none'; document.getElementById('_2_44_Open_Text').style.display='none'; document.getElementById('_2_44_Closed_Image').style.display='inline'; document.getElementById('_2_44_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" id="_2_44_Closed_Image" onclick="this.style.display='none'; document.getElementById('_2_44_Closed_Text').style.display='none'; document.getElementById('_2_44_Open_Image').style.display='inline'; document.getElementById('_2_44_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" /><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">&lt;%</span><span id="_2_44_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">...</span><span id="_2_44_Open_Text"><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">@&nbsp;page&nbsp;contentType</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&quot;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">text/html;&nbsp;charset=GBK</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&quot;</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">html</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">head</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">meta&nbsp;</span><span style="COLOR: #ff0000">http-equiv</span><span style="COLOR: #0000ff">=&quot;Content-Type&quot;</span><span style="COLOR: #ff0000">&nbsp;content</span><span style="COLOR: #0000ff">=&quot;text/html;&nbsp;charset=GBK&quot;</span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">title</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">作者李刚已经出版的图书：</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">title</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">head</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">body</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />作者已经出版的图书：</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">p</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />Spring2.0宝典</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">br</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />轻量级J2EE企业实战</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">br</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />基于J2EE的Ajax宝典</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">br</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">body</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">html</span><span style="COLOR: #0000ff">&gt;</span></div></div><p>&nbsp;</p><p>login.jsp</p><p>&nbsp;</p><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: 95%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"><div><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" id="_2_60_Open_Image" onclick="this.style.display='none'; document.getElementById('_2_60_Open_Text').style.display='none'; document.getElementById('_2_60_Closed_Image').style.display='inline'; document.getElementById('_2_60_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" id="_2_60_Closed_Image" onclick="this.style.display='none'; document.getElementById('_2_60_Closed_Text').style.display='none'; document.getElementById('_2_60_Open_Image').style.display='inline'; document.getElementById('_2_60_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" /><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">&lt;%</span><span id="_2_60_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">...</span><span id="_2_60_Open_Text"><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">@&nbsp;page&nbsp;language</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&quot;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">java</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&quot;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;contentType</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&quot;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">text/html;&nbsp;charset=GBK</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&quot;</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" id="_66_102_Open_Image" onclick="this.style.display='none'; document.getElementById('_66_102_Open_Text').style.display='none'; document.getElementById('_66_102_Closed_Image').style.display='inline'; document.getElementById('_66_102_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" id="_66_102_Closed_Image" onclick="this.style.display='none'; document.getElementById('_66_102_Closed_Text').style.display='none'; document.getElementById('_66_102_Open_Image').style.display='inline'; document.getElementById('_66_102_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" /></span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">&lt;%</span><span id="_66_102_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">...</span><span id="_66_102_Open_Text"><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">@taglib&nbsp;prefix</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&quot;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">s</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&quot;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;uri</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&quot;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">/struts-tags</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&quot;</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" id="_109_135_Open_Image" onclick="this.style.display='none'; document.getElementById('_109_135_Open_Text').style.display='none'; document.getElementById('_109_135_Closed_Image').style.display='inline'; document.getElementById('_109_135_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" id="_109_135_Closed_Image" onclick="this.style.display='none'; document.getElementById('_109_135_Closed_Text').style.display='none'; document.getElementById('_109_135_Open_Image').style.display='inline'; document.getElementById('_109_135_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" /></span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">&lt;%</span><span id="_109_135_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">...</span><span id="_109_135_Open_Text"><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">@&nbsp;page&nbsp;isELIgnored</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&quot;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">false</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&quot;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" id="_141_200_Open_Image" onclick="this.style.display='none'; document.getElementById('_141_200_Open_Text').style.display='none'; document.getElementById('_141_200_Closed_Image').style.display='inline'; document.getElementById('_141_200_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" id="_141_200_Closed_Image" onclick="this.style.display='none'; document.getElementById('_141_200_Closed_Text').style.display='none'; document.getElementById('_141_200_Open_Image').style.display='inline'; document.getElementById('_141_200_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" /></span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">&lt;%</span>span<span id="_141_200_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px so</div></div>
          <br/>
          <span style="color:red;">
            <a href="http://esffor.javaeye.com/blog/168172#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/92' target='_blank'><span style="color:red;font-weight:bold;">快来参加7月17日在成都举行的SOA中国技术论坛</span></a></li><li><a href='/adverts/106' target='_blank'><span style="color:blue;font-weight:bold;">JavaEye问答大赛开始了！ 从6月23日 至 7月6日，奖品丰厚 ！</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Fri, 29 Feb 2008 15:23:07 +0800</pubDate>
        <link>http://esffor.javaeye.com/blog/168172</link>
        <guid>http://esffor.javaeye.com/blog/168172</guid>
      </item>
      <item>
        <title>《struts2权威指南》学习笔记之struts2之文件下载</title>
        <author>esffor</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://esffor.javaeye.com">esffor</a>&nbsp;
          链接：<a href="http://esffor.javaeye.com/blog/168173" style="color:red;">http://esffor.javaeye.com/blog/168173</a>&nbsp;
          发表时间: 2008年02月29日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p>对于服务器上的英文名的文件，可以方便的使用&lt;a href=&quot;&quot;/&gt;&lt;/a&gt;进行下载，但如果是中文文件名的文件，如果使用&lt;a href=&quot;中.jpg&quot;&gt;&lt;/a&gt; 就会出现连接上的乱码（如%4e%54%79），为了解决这个问题，struts2通过一个文件下载拦截器支持中文命名文件的下载</p><p>首先编写web.xml</p><p>&nbsp;</p><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: 95%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"><div><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><span style="COLOR: #0000ff">&lt;?</span><span style="COLOR: #ff00ff">xml&nbsp;version=&quot;1.0&quot;&nbsp;encoding=&quot;UTF-8&quot;</span><span style="COLOR: #0000ff">?&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">web-app&nbsp;</span><span style="COLOR: #ff0000">version</span><span style="COLOR: #0000ff">=&quot;2.5&quot;</span><span style="COLOR: #ff0000">&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;xmlns</span><span style="COLOR: #0000ff">=&quot;http://java.sun.com/xml/ns/javaee&quot;</span><span style="COLOR: #ff0000">&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;xmlns:xsi</span><span style="COLOR: #0000ff">=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span><span style="COLOR: #ff0000">&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;xsi:schemaLocation</span><span style="COLOR: #0000ff">=&quot;http://java.sun.com/xml/ns/javaee&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter-name</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">struts2</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter-name</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter-class</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">org.apache.struts2.dispatcher.FilterDispatcher</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter-class</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter-mapping</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter-name</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">struts2</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter-name</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">url-pattern</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">/*</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">url-pattern</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter-mapping</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter-name</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">struts-cleanup</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter-name</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter-class</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">org.apache.struts2.dispatcher.ActionContextCleanUp</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter-class</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter-mapping</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">filter-name</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">struts-cleanup</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter-name</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">url-pattern</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">/*</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">url-pattern</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">filter-mapping</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">web-app</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span></div></div><p>&nbsp;文件下载Action</p><p>struts2的文件下载Action与普通的Action并没有太大不同，仅仅是该action需要提供一个返回InputStream流的方法<br />，该输入流代表了被下载文件的入口，该Action类代码如下：</p><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: 95%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"><div><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><span style="COLOR: #0000ff">package</span><span style="COLOR: #000000">&nbsp;lee;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;java.io.InputStream;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;org.apache.struts2.ServletActionContext;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;com.opensymphony.xwork2.Action;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;FileDownloadAction&nbsp;</span><span style="COLOR: #0000ff">implements</span><span style="COLOR: #000000">&nbsp;Action&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" id="_380_808_Open_Image" onclick="this.style.display='none'; document.getElementById('_380_808_Open_Text').style.display='none'; document.getElementById('_380_808_Closed_Image').style.display='inline'; document.getElementById('_380_808_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" id="_380_808_Closed_Image" onclick="this.style.display='none'; document.getElementById('_380_808_Closed_Text').style.display='none'; document.getElementById('_380_808_Open_Image').style.display='inline'; document.getElementById('_380_808_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" /></span><span id="_380_808_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">...</span><span id="_380_808_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">&nbsp;String&nbsp;inputPath;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;setInputPath(String&nbsp;value)<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_457_490_Open_Image" onclick="this.style.display='none'; document.getElementById('_457_490_Open_Text').style.display='none'; document.getElementById('_457_490_Closed_Image').style.display='inline'; document.getElementById('_457_490_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_457_490_Closed_Image" onclick="this.style.display='none'; document.getElementById('_457_490_Closed_Text').style.display='none'; document.getElementById('_457_490_Open_Image').style.display='inline'; document.getElementById('_457_490_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="_457_490_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">...</span><span id="_457_490_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inputPath&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;value;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_494_572_Open_Image" onclick="this.style.display='none'; document.getElementById('_494_572_Open_Text').style.display='none'; document.getElementById('_494_572_Closed_Image').style.display='inline'; document.getElementById('_494_572_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_494_572_Closed_Image" onclick="this.style.display='none'; document.getElementById('_494_572_Closed_Text').style.display='none'; document.getElementById('_494_572_Open_Image').style.display='inline'; document.getElementById('_494_572_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="_494_572_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">/**/</span><span id="_494_572_Open_Text"><span style="COLOR: #008000">/*</span><span style="COLOR: #008000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;下载用的Action应该返回一个InputStream实例，<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;该方法对应在result里的inputName属性值为targetFile<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">*/</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;InputStream&nbsp;getTargetFile()&nbsp;</span><span style="COLOR: #0000ff">throws</span><span style="COLOR: #000000">&nbsp;Exception&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_632_726_Open_Image" onclick="this.style.display='none'; document.getElementById('_632_726_Open_Text').style.display='none'; document.getElementById('_632_726_Closed_Image').style.display='inline'; document.getElementById('_632_726_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_632_726_Closed_Image" onclick="this.style.display='none'; document.getElementById('_632_726_Closed_Text').style.display='none'; document.getElementById('_632_726_Open_Image').style.display='inline'; document.getElementById('_632_726_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="_632_726_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">...</span><span id="_632_726_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;ServletActionContext.getServletContext().getResourceAsStream(inputPath);<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;String&nbsp;execute()&nbsp;</span><span style="COLOR: #0000ff">throws</span><span style="COLOR: #000000">&nbsp;Exception<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_775_805_Open_Image" onclick="this.style.display='none'; document.getElementById('_775_805_Open_Text').style.display='none'; document.getElementById('_775_805_Closed_Image').style.display='inline'; document.getElementById('_775_805_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_775_805_Closed_Image" onclick="this.style.display='none'; document.getElementById('_775_805_Closed_Text').style.display='none'; document.getElementById('_775_805_Open_Image').style.display='inline'; document.getElementById('_775_805_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="_775_805_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">...</span><span id="_775_805_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;SUCCESS;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span></div></div><p>配置Action</p><p>contentType:指定被下载文件的文件类型<br />inputName:指定被下载文件的入口输入流<br />contentDisposition:指定下载文件的文件名<br />bufferSize:指定下载文件时的缓冲大小</p><p>因为stream结果类型的逻辑视图是返回给客户端一个输入流，因此无需指定location属性</p><p>&nbsp;</p><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: 95%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"><div><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><span style="COLOR: #0000ff">&lt;?</span><span style="COLOR: #ff00ff">xml&nbsp;version=&quot;1.0&quot;&nbsp;encoding=&quot;GBK&quot;</span><span style="COLOR: #0000ff">?&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">&lt;!</span><span style="COLOR: #ff00ff">DOCTYPE&nbsp;struts&nbsp;PUBLIC<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&quot;-//Apache&nbsp;Software&nbsp;Foundation//DTD&nbsp;Struts&nbsp;Configuration&nbsp;2.0//EN&quot;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&quot;http://struts.apache.org/dtds/struts-2.0.dtd&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">struts</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">constant&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;struts.custom.i18n.resources&quot;</span><span style="COLOR: #ff0000">&nbsp;value</span><span style="COLOR: #0000ff">=&quot;globalMessages&quot;</span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">constant&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;struts.i18n.encoding&quot;</span><span style="COLOR: #ff0000">&nbsp;value</span><span style="COLOR: #0000ff">=&quot;GBK&quot;</span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">package&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;lee&quot;</span><span style="COLOR: #ff0000">&nbsp;extends</span><span style="COLOR: #0000ff">=&quot;struts-default&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">default-action-ref&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;download&quot;</span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">action&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;download&quot;</span><span style="COLOR: #ff0000">&nbsp;class</span><span style="COLOR: #0000ff">=&quot;lee.FileDownloadAction&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">param&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;inputPath&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">images中.gif</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">param</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">result&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;success&quot;</span><span style="COLOR: #ff0000">&nbsp;type</span><span style="COLOR: #0000ff">=&quot;stream&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">param&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;contentType&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">image/gif</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">param</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">param&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;inputName&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">targetFile</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">param</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">param&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;contentDisposition&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">filename=&quot;struts.gif&quot;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">param</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">param&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;bufferSize&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">4096</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">param</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">result</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">action</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">action&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">=&quot;login&quot;</span><span style="COLOR: #ff0000">&nbsp;class</span><span style="COLOR: #0000ff">=&quot;lee.LoginAction&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">result</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">/stuts2Down.html</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">result</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">action</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">package</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">struts</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span></div></div><p>登陆Action:</p><p>&nbsp;</p><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: 95%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"><div><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><span style="COLOR: #0000ff">package</span><span style="COLOR: #000000">&nbsp;lee;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;java.io.InputStream;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;org.apache.struts2.ServletActionContext;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;com.opensymphony.xwork2.Action;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;com.opensymphony.xwork2.ActionContext;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;LoginAction&nbsp;</span><span style="COLOR: #0000ff">implements</span><span style="COLOR: #000000">&nbsp;Action&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" id="_220_620_Open_Image" onclick="this.style.display='none'; document.getElementById('_220_620_Open_Text').style.display='none'; document.getElementById('_220_620_Closed_Image').style.display='inline'; document.getElementById('_220_620_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" id="_220_620_Closed_Image" onclick="this.style.display='none'; document.getElementById('_220_620_Closed_Text').style.display='none'; document.getElementById('_220_620_Open_Image').style.display='inline'; document.getElementById('_220_620_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" /></span><span id="_220_620_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">...</span><span id="_220_620_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">&nbsp;String&nbsp;user;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">&nbsp;String&nbsp;pass;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;setUser(String&nbsp;user)<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_304_328_Open_Image" onclick="this.style.display='none'; document.getElementById('_304_328_Open_Text').style.display='none'; document.getElementById('_304_328_Closed_Image').style.display='inline'; document.getElementById('_304_328_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_304_328_Closed_Image" onclick="this.style.display='none'; document.getElementById('_304_328_Closed_Text').style.display='none'; document.getElementById('_304_328_Open_Image').style.display='inline'; document.getElementById('_304_328_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="_304_328_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">...</span><span id="_304_328_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">.user&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;user;&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;String&nbsp;getUser()&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_357_383_Open_Image" onclick="this.style.display='none'; document.getElementById('_357_383_Open_Text').style.display='none'; document.getElementById('_357_383_Closed_Image').style.display='inline'; document.getElementById('_357_383_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_357_383_Closed_Image" onclick="this.style.display='none'; document.getElementById('_357_383_Closed_Text').style.display='none'; document.getElementById('_357_383_Open_Image').style.display='inline'; document.getElementById('_357_383_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="_357_383_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">...</span><span id="_357_383_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;(</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">.user);&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;setPass(String&nbsp;pass)<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_422_446_Open_Image" onclick="this.style.display='none'; document.getElementById('_422_446_Open_Text').style.display='none'; document.getElementById('_422_446_Closed_Image').style.display='inline'; document.getElementById('_422_446_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_422_446_Closed_Image" onclick="this.style.display='none'; document.getElementById('_422_446_Closed_Text').style.display='none'; document.getElementById('_422_446_Open_Image').style.display='inline'; document.getElementById('_422_446_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="_422_446_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">...</span><span id="_422_446_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">.pass&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;pass;&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;String&nbsp;getPass()<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_475_501_Open_Image" onclick="this.style.display='none'; document.getElementById('_475_501_Open_Text').style.display='none'; document.getElementById('_475_501_Closed_Image').style.display='inline'; document.getElementById('_475_501_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_475_501_Closed_Image" onclick="this.style.display='none'; document.getElementById('_475_501_Closed_Text').style.display='none'; document.getElementById('_475_501_Open_Image').style.display='inline'; document.getElementById('_475_501_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="_475_501_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">...</span><span id="_475_501_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;(</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">.pass);&nbsp;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" /><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;String&nbsp;execute()<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" id="_530_618_Open_Image" onclick="this.style.display='none'; document.getElementById('_530_618_Open_Text').style.display='none'; document.getElementById('_530_618_Closed_Image').style.display='inline'; document.getElementById('_530_618_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" id="_530_618_Closed_Image" onclick="this.style.display='none'; document.getElementById('_530_618_Closed_Text').style.display='none'; document.getElementById('_530_618_Open_Image').style.display='inline'; document.getElementById('_530_618_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="_530_618_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">...</span><span id="_530_618_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ActionContext.getContext().getSession().put(</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">user</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">&nbsp;,&nbsp;getUser());<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;SUCCESS;<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span></div></div><p>&nbsp;</p><p>资源文件：globalMessages.properties 内容为空</p><p>登陆页面：input..jsp</p><p>&nbsp;</p><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: 95%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"><div><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" id="_2_43_Open_Image" onclick="this.style.display='none'; document.getElementById('_2_43_Open_Text').style.display='none'; document.getElementById('_2_43_Closed_Image').style.display='inline'; document.getElementById('_2_43_Closed_Text').style.display='inline';" align="top" alt="" /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" id="_2_43_Closed_Image" onclick="this.style.display='none'; document.getElementById('_2_43_Closed_Text').style.display='none'; document.getElementById('_2_43_Open_Image').style.display='inline'; document.getElementById('_2_43_Open_Text').style.display='inline';" align="top" alt="" style="DISPLAY: none" /><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">&lt;%</span><span id="_2_43_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">...</span><span id="_2_43_Open_Text"><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">@&nbsp;page&nbsp;contentType</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&quot;</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">text/html;charset=GBK</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&quot;</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">&lt;!</span><span style="COLOR: #ff00ff">DOCTYPE&nbsp;HTML&nbsp;PUBLIC&nbsp;&quot;-//W3C//DTD&nbsp;HTML&nbsp;4.0&nbsp;Transitional//EN&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">HTML</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">HEAD</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">TITLE</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">&nbsp;下载前的登陆页面&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">TITLE</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">HEAD</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">BODY</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">h3</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">下载前的登陆页面</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">h3</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;${requestScope.tip}<br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">FORM&nbsp;</span><span style="COLOR: #ff0000">METHOD</span><span style="COLOR: #0000ff">=&quot;POST&quot;</span><span style="COLOR: #ff0000">&nbsp;ACTION</span><span style="COLOR: #0000ff">=&quot;login.action&quot;</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;用户名:</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">INPUT&nbsp;</span><span style="COLOR: #ff0000">TYPE</span><span style="COLOR: #0000ff">=&quot;text&quot;</span><span style="COLOR: #ff0000">&nbsp;NAME</span><span style="COLOR: #0000ff">=&quot;user&quot;</span><span style="COLOR: #0000ff">/&gt;&lt;</span><span style="COLOR: #800000">br</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;密码：</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">INPUT&nbsp;</span><span style="COLOR: #ff0000">TYPE</span><span style="COLOR: #0000ff">=&quot;text&quot;</span><span style="COLOR: #ff0000">&nbsp;NAME</span><span style="COLOR: #0000ff">=&quot;pass&quot;</span><span style="COLOR: #0000ff">/&gt;&lt;</span><span style="COLOR: #800000">br</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">INPUT&nbsp;</span><span style="COLOR: #ff0000">TYPE</span><span style="COLOR: #0000ff">=