﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-Java,永远不敢言精通-随笔分类-Struts1.0</title><link>http://www.blogjava.net/crazycoding/category/43593.html</link><description>You are good at what you love; you love what you are good at .</description><language>zh-cn</language><lastBuildDate>Sun, 31 Jan 2010 17:53:55 GMT</lastBuildDate><pubDate>Sun, 31 Jan 2010 17:53:55 GMT</pubDate><ttl>60</ttl><item><title>开始struts1.0的准备——MVC</title><link>http://www.blogjava.net/crazycoding/archive/2010/01/31/311370.html</link><dc:creator>Ying-er</dc:creator><author>Ying-er</author><pubDate>Sun, 31 Jan 2010 00:43:00 GMT</pubDate><guid>http://www.blogjava.net/crazycoding/archive/2010/01/31/311370.html</guid><wfw:comment>http://www.blogjava.net/crazycoding/comments/311370.html</wfw:comment><comments>http://www.blogjava.net/crazycoding/archive/2010/01/31/311370.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/crazycoding/comments/commentRss/311370.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/crazycoding/services/trackbacks/311370.html</trackback:ping><description><![CDATA[<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 11" />
<meta name="Originator" content="Microsoft Word 11" />
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Csamsung%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" /><!--[if gte mso 9]><xml>
Normal
0
7.8 磅
0
2
false
false
false
MicrosoftInternetExplorer4
</xml><![endif]--><!--[if gte mso 9]><![endif]--><style>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:""@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Times New Roman";}
/* Page Definitions */
@page
{}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{
mso-style-parent:"";
font-size:10.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
</style>
<![endif]-->
<p><strong><em><span style="font-size: 16pt; font-family: 宋体; color: blue;">几个概念：</span></em></strong></p>
<p>Domain Model <span style="font-family: 宋体;">领域模型</span>--&gt;<span style="font-family: 宋体;">对象模型（核心）</span></p>
<p>&nbsp;DDD<span style="font-family: 宋体;">（领域驱动设计）</span></p>
<p>Pattern <span style="font-family: 宋体;">代码级</span>
<span style="font-family: 宋体;">架构级</span> <span style="font-family: 宋体;">分析（</span>RBAC <span style="font-family: 宋体;">基于角色的管理）</span></p>
<p>Framework <span style="font-family: 宋体;">框架——基础性的设施</span></p>
<p><strong><em><span style="font-size: 16pt; font-family: 宋体; color: blue;">多层架构概述</span></em></strong></p>
<p>C/S<span style="font-family: 宋体;">：以数据库为中心</span></p>
<p>B/S<span style="font-family: 宋体;">：多层架构才是真正的目的，业务运算、数据库等功能</span></p>
<p><span style="font-family: 宋体;">完全分离，杜绝彼此的耦合与影响，从而实现耦合和良好的可维护性。</span></p>
<p><span style="font-family: 宋体;">复习：</span>C/S<span style="font-family: 宋体;">，</span>B/S<span style="font-family: 宋体;">的优缺点：</span></p>
<p><strong><em><span style="color: blue;">C/S </span></em></strong><strong><em><span style="font-family: 宋体; color: blue;">优点：</span></em></strong></p>
<p><span style="color: #ff6600;">1.C/S</span><span style="font-family: 宋体; color: #ff6600;">架构的界面和操作可以很丰富。</span><span style="color: #ff6600;">&nbsp;</span></p>
<p><span style="color: #ff6600;">2.</span><span style="font-family: 宋体; color: #ff6600;">安全性能可以很容易保证，实现多层认证也不难。</span></p>
<p><span style="color: #ff6600;">3.</span><span style="font-family: 宋体; color: #ff6600;">由于只有一层交互，因此响应速度较快。</span></p>
<p><strong><em><span style="color: blue;">C/S </span></em></strong><strong><em><span style="font-family: 宋体; color: blue;">缺点：</span></em></strong></p>
<p><span style="color: #ff6600;">&nbsp;1.</span><span style="font-family: 宋体; color: #ff6600;">适用面窄，通常用于局域网中。</span></p>
<p><span style="color: #ff6600;">&nbsp;2.</span><span style="font-family: 宋体; color: #ff6600;">用户群固定。由于程序需要安装才可使用，因此不适合面向一些不可知的用户。</span></p>
<p><span style="color: #ff6600;">&nbsp;3.</span><span style="font-family: 宋体; color: #ff6600;">维护成本高，发生一次升级，则所有客户端的程序都需要改变。</span></p>
<p style="text-indent: 5.25pt;"><strong><em><span style="color: blue;">B/S </span></em></strong><strong><em><span style="font-family: 宋体; color: blue;">优点：</span></em></strong></p>
<p>&nbsp;<span style="color: #ff6600;">1</span><span style="font-family: 宋体; color: #ff6600;">）客户端无需安装，有</span><span style="color: #ff6600;">Web</span><span style="font-family: 宋体; color: #ff6600;">浏览器即可。</span></p>
<p><span style="color: #ff6600;">&nbsp;2</span><span style="font-family: 宋体; color: #ff6600;">）</span><span style="color: #ff6600;">BS</span><span style="font-family: 宋体; color: #ff6600;">架构可以直接放在广域网上，通过一定的权限控制实现多客户访问的目的，交互性较强。</span></p>
<p><span style="color: #ff6600;">&nbsp;3</span><span style="font-family: 宋体; color: #ff6600;">）</span><span style="color: #ff6600;">BS</span><span style="font-family: 宋体; color: #ff6600;">架构无需升级多个客户端，升级服务器即可。</span></p>
<p>&nbsp;<strong><em><span style="color: blue;">B/S </span></em></strong><strong><em><span style="font-family: 宋体; color: blue;">缺点：</span></em></strong></p>
<p>&nbsp;<span style="color: #ff6600;">1</span><span style="font-family: 宋体; color: #ff6600;">）在跨浏览器上，</span><span style="color: #ff6600;">BS</span><span style="font-family: 宋体; color: #ff6600;">架构不尽如人意。</span></p>
<p><span style="color: #ff6600;">&nbsp;2</span><span style="font-family: 宋体; color: #ff6600;">）</span><span style="color: #ff6600;"> BS</span><span style="font-family: 宋体; color: #ff6600;">架构的表现要达到</span><span style="color: #ff6600;">CS</span><span style="font-family: 宋体; color: #ff6600;">程序的程度需要花费不少精力。</span></p>
<p><span style="color: #ff6600;">&nbsp;3</span><span style="font-family: 宋体; color: #ff6600;">）在速度和安全性上需要花费巨大的设计成本，这是</span><span style="color: #ff6600;">BS</span><span style="font-family: 宋体; color: #ff6600;">架构的最大问题。</span></p>
<p><span style="color: #ff6600;">&nbsp;4</span><span style="font-family: 宋体; color: #ff6600;">）客户端服务器端的交互是请求</span><span style="color: #ff6600;">-</span><span style="font-family: 宋体; color: #ff6600;">响应模式，通常需要刷新页面，这并不是客户乐意去做的。（在</span><span style="color: #ff6600;">Ajax</span><span style="font-family: 宋体; color: #ff6600;">实用化后此问题得到了一定程度的缓解）</span></p>
<p><strong><em><span style="font-size: 16pt; color: blue;">SSH</span></em></strong><strong><em><span style="font-size: 16pt; font-family: 宋体; color: blue;">分别所处的位置：</span></em></strong></p>
<p><span style="font-family: 宋体;">呈现层（</span><span>UI
Layer/Presentation Layer</span><span style="font-family: 宋体;">）</span> struts</p>
<p><span style="font-family: 宋体;">业务逻辑层（</span><span>Business
Layer</span><span style="font-family: 宋体;">）</span> spring</p>
<p><span style="font-family: 宋体;">持久化层（</span><span>Persistent
Layer</span><span style="font-family: 宋体;">）</span> hibernate</p>
<p><span style="font-family: 宋体;">具体如下图：</span></p>
<p><span style="font-family: 宋体;"><img alt="" src="http://www.blogjava.net/images/blogjava_net/crazycoding/images002.jpg" width="554" height="236" /></span></p>
<p>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 11" />
<meta name="Originator" content="Microsoft Word 11" />
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Csamsung%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" /><!--[if gte mso 9]><xml>
Normal
0
7.8 磅
0
2
false
false
false
MicrosoftInternetExplorer4
</xml><![endif]--><!--[if gte mso 9]><![endif]--><style>
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:""@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Times New Roman";}
/* Page Definitions */
@page
{}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{}
@list l0:level1
{
list-style-image:url("file:///C:/DOCUME~1/samsung/LOCALS~1/Temp/msohtml1/01/clip_image001.gif");
margin-left:21.0pt;
text-indent:-21.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{
mso-style-parent:"";
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]-->
<p style="margin-left: 21pt; text-indent: -21pt;"><strong><em><span style="font-size: 16pt; font-family: 宋体; color: blue;">关于</span></em></strong><strong><em><span style="font-size: 16pt; color: blue;">MVC</span></em></strong><strong><em><span style="font-size: 16pt; font-family: 宋体; color: blue;">：</span></em></strong></p>
<p><span style="font-family: 宋体;">平常写</span>Web<span style="font-family: 宋体;">（</span>tomcat + Jsp + servlet<span style="font-family: 宋体;">）时的一个很普通的例子：</span></p>
<p><br />
</p>
<p><span style="font-family: 宋体;"><img alt="" src="http://www.blogjava.net/images/blogjava_net/crazycoding/image003.jpg" width="553" height="370" /></span></p>
<p><br />
</p>
<p>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 11" />
<meta name="Originator" content="Microsoft Word 11" />
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Csamsung%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" /><!--[if gte mso 9]><xml>
Normal
0
7.8 磅
0
2
false
false
false
MicrosoftInternetExplorer4
</xml><![endif]--><!--[if gte mso 9]><![endif]--><style>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:""@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Times New Roman";}
/* Page Definitions */
@page
{}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{
mso-style-parent:"";
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]-->
<p><strong><em><span style="background: yellow none repeat scroll 0% 0%; color: fuchsia; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">MVC1 &amp; MVC2</span></em></strong><strong><em><span style="background: yellow none repeat scroll 0% 0%; font-family: 宋体; color: fuchsia; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">的区别：</span></em></strong></p>
<p>mvc1:jsp<span style="font-family: 宋体;">职责：显示，参数获取，</span>
<span style="font-family: 宋体;">模型层的调用，</span> <span style="font-family: 宋体;">转向（小型项目）</span></p>
<p>mvc2<span style="font-family: 宋体;">：从</span>jsp<span style="font-family: 宋体;">抽取出控制器（</span>servlet<span style="font-family: 宋体;">）</span></p>
<p><br />
</p>
<p><span style="font-family: 宋体;"><img alt="" src="http://www.blogjava.net/images/blogjava_net/crazycoding/image004.jpg" width="238" height="265" /><img alt="" src="http://www.blogjava.net/images/blogjava_net/crazycoding/image005.jpg" width="316" align="right" height="272" /></span></p>
<p><span style="font-family: 宋体;"><img alt="" src="http://www.blogjava.net/images/blogjava_net/crazycoding/image007.jpg" width="283" height="266" /><img alt="" src="http://www.blogjava.net/images/blogjava_net/crazycoding/image006.jpg" width="282" align="right" height="303" /></span></p>
<p>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 11" />
<meta name="Originator" content="Microsoft Word 11" />
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Csamsung%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" /><!--[if gte mso 9]><xml>
Normal
0
7.8 磅
0
2
false
false
false
MicrosoftInternetExplorer4
</xml><![endif]--><!--[if gte mso 9]><![endif]--><style>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:""@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Times New Roman";}
/* Page Definitions */
@page
{}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{
mso-style-parent:"";
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]-->
<p><span style="background: yellow none repeat scroll 0% 0%; color: fuchsia; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">mvc</span><span style="background: yellow none repeat scroll 0% 0%; font-family: 宋体; color: fuchsia; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">实现原理：</span></p>
<p><span style="font-family: 宋体;">通过一个类来统一截获所有请求</span></p>
<p><span style="font-family: 宋体;">分为两种：</span></p>
<p><span style="font-family: 宋体;">面向请求驱动——</span>struts1.x<span style="font-family: 宋体;">，</span>struts2.x webwork</p>
<p><span style="font-family: 宋体;">面向事件驱动——</span> JSF</p>
<p><span style="background: yellow none repeat scroll 0% 0%; font-family: 宋体; color: fuchsia; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">面向请求驱动原理：</span></p>
<p><span style="background: yellow none repeat scroll 0% 0%; font-family: 宋体; color: fuchsia; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"><img alt="" src="http://www.blogjava.net/images/blogjava_net/crazycoding/image008.jpg" width="473" height="237" /></span></p>
<p><span style="background: yellow none repeat scroll 0% 0%; font-family: 宋体; color: fuchsia; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"><img alt="" src="http://www.blogjava.net/images/blogjava_net/crazycoding/image009.jpg" width="476" height="229" /></span></p>
<p>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 11" />
<meta name="Originator" content="Microsoft Word 11" />
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Csamsung%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" /><!--[if gte mso 9]><xml>
Normal
0
7.8 磅
0
2
false
false
false
MicrosoftInternetExplorer4
</xml><![endif]--><!--[if gte mso 9]><![endif]--><style>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:""@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Times New Roman";}
/* Page Definitions */
@page
{}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{
mso-style-parent:"";
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]-->
<p><span style="background: yellow none repeat scroll 0% 0%; color: #ff6600; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">Struts </span><span style="background: yellow none repeat scroll 0% 0%; font-family: 宋体; color: #ff6600; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">的</span><span style="background: yellow none repeat scroll 0% 0%; color: #ff6600; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">MVC</span><span style="background: yellow none repeat scroll 0% 0%; font-family: 宋体; color: #ff6600; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">实现：</span></p>
<p><span style="background: yellow none repeat scroll 0% 0%; font-family: 宋体; color: #ff6600; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"><img alt="" src="http://www.blogjava.net/images/blogjava_net/crazycoding/image010.jpg" width="457" height="236" /></span></p>
<p><span style="background: yellow none repeat scroll 0% 0%; font-family: 宋体; color: #ff6600; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"><img alt="" src="http://www.blogjava.net/images/blogjava_net/crazycoding/image011.jpg" width="452" height="349" /><br />
</span></p>
</p>
</p>
</p>
</p>
<img src ="http://www.blogjava.net/crazycoding/aggbug/311370.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/crazycoding/" target="_blank">Ying-er</a> 2010-01-31 08:43 <a href="http://www.blogjava.net/crazycoding/archive/2010/01/31/311370.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Struts1.0国际化整理</title><link>http://www.blogjava.net/crazycoding/archive/2010/01/14/309515.html</link><dc:creator>Ying-er</dc:creator><author>Ying-er</author><pubDate>Thu, 14 Jan 2010 11:48:00 GMT</pubDate><guid>http://www.blogjava.net/crazycoding/archive/2010/01/14/309515.html</guid><wfw:comment>http://www.blogjava.net/crazycoding/comments/309515.html</wfw:comment><comments>http://www.blogjava.net/crazycoding/archive/2010/01/14/309515.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/crazycoding/comments/commentRss/309515.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/crazycoding/services/trackbacks/309515.html</trackback:ping><description><![CDATA[对应表单：<br />
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">html:form&nbsp;</span><span style="color: rgb(255, 0, 0);">action</span><span style="color: rgb(0, 0, 255);">="/HelloWorld.do"</span><span style="color: rgb(255, 0, 0);">&nbsp;onsubmit</span><span style="color: rgb(0, 0, 255);">="return&nbsp;check();"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">bean:message&nbsp;</span><span style="color: rgb(255, 0, 0);">key</span><span style="color: rgb(0, 0, 255);">="name"</span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">html:text&nbsp;</span><span style="color: rgb(255, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">="name"</span><span style="color: rgb(255, 0, 0);">&nbsp;size</span><span style="color: rgb(0, 0, 255);">="16"</span><span style="color: rgb(255, 0, 0);">&nbsp;maxlength</span><span style="color: rgb(0, 0, 255);">="16"</span><span style="color: rgb(255, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">&gt;&lt;/</span><span style="color: rgb(128, 0, 0);">html:text</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">html:submit&nbsp;</span><span style="color: rgb(255, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">="submit"</span><span style="color: rgb(255, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">&gt;&lt;</span><span style="color: rgb(128, 0, 0);">bean:message&nbsp;</span><span style="color: rgb(255, 0, 0);">key</span><span style="color: rgb(0, 0, 255);">="submit"</span><span style="color: rgb(255, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">/&gt;&lt;/</span><span style="color: rgb(128, 0, 0);">html:submit</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">html:form</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />
</span></div>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 11" />
<meta name="Originator" content="Microsoft Word 11" />
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Csamsung%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" /><!--[if gte mso 9]><xml>
Normal
0
7.8 磅
0
2
false
false
false
MicrosoftInternetExplorer4
</xml><![endif]--><!--[if gte mso 9]><![endif]--><style>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:""@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Times New Roman";}
/* Page Definitions */
@page
{}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{}
@list l0:level1
{
margin-left:18.0pt;
text-indent:-18.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{
mso-style-parent:"";
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]-->
<p style="margin-left: 18pt; text-indent: -18pt;"><strong><span style="font-size: 16pt; color: rgb(51, 102, 255);"><span>&nbsp;1.<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;
</span></span></span></strong><strong><span style="font-size: 16pt; font-family: 宋体; color: rgb(51, 102, 255);">制定母本，</span></strong><strong><span style="font-size: 16pt; color: rgb(51, 102, 255);">key-E</span></strong></p>
<p style="margin-left: 18pt;"><span style="font-family: 宋体;">例：文件名：</span>app.txt</p>
<p style="margin-left: 18pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: 宋体;">内容：</span>name=name</p>
<p style="margin-left: 63pt; text-indent: 10.5pt;">submit=password</p>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 11" />
<meta name="Originator" content="Microsoft Word 11" />
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Csamsung%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" /><!--[if gte mso 9]><xml>
Normal
0
7.8 磅
0
2
false
false
false
MicrosoftInternetExplorer4
</xml><![endif]--><!--[if gte mso 9]><![endif]--><!--[if !mso]>
<style>
st1":*{behavior:url(#ieooui) }
</style>
<![endif]--><style>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:""@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Times New Roman";}
/* Page Definitions */
@page
{}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{}
@list l0:level1
{
margin-left:18.0pt;
text-indent:-18.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{
mso-style-parent:"";
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]-->
<p style="margin-left: 18pt; text-indent: -18pt;"><strong><span style="font-size: 16pt; color: rgb(51, 102, 255);"><span>&nbsp;2.<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;
</span></span></span></strong><strong><span style="font-size: 16pt; font-family: 宋体; color: rgb(51, 102, 255);">将母本转为</span></strong><strong><span style="font-size: 16pt; color: rgb(51, 102, 255);">Unicode</span></strong><strong><span style="font-size: 16pt; font-family: 宋体; color: rgb(51, 102, 255);">码</span></strong></p>
<p style="margin-left: 18pt;"><span style="font-family: 宋体;">将文件</span>app.txt<span style="font-family: 宋体;">拷贝到</span>jdk<span style="font-family: 宋体;">的安装目录下的</span>bin<span style="font-family: 宋体;">文件夹内</span></p>
<p style="margin-left: 18pt;"><span style="font-family: 宋体;">例：路径：</span>C:"Program Files"Java"jdk1.5.0_06"bin</p>
<p style="margin-left: 18pt;"><span style="font-family: 宋体;">开始</span>----<span style="font-family: 宋体;">运行</span><span>------cmd
------- cd C:"Program Files"Java"jdk1.5.0_06"bin</span></p>
<p style="margin-left: 18pt;"><span style="font-family: 宋体;">打命令：</span><span style="background: yellow none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">native2ascii
-encoding GB2312 app.txt app.properties</span></p>
<p style="margin-left: 18pt;"><span style="font-family: 宋体; color: fuchsia;">注释</span><span style="font-family: 宋体;">：</span>GB2312 <span style="font-family: 宋体;">是生成后的字符集，</span>app.txt<span style="font-family: 宋体;">是目标文件，</span>app.properties<span style="font-family: 宋体;">是生成后的文件</span><span style="font-family: 宋体;">名</span></p>
<p style="margin-left: 18pt;"><span style="font-family: 宋体;">将生成的属性文件</span>app.properties<span style="font-family: 宋体;">复制到</span>res</p>
<p style="margin-left: 18pt;">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 11" />
<meta name="Originator" content="Microsoft Word 11" />
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Csamsung%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" /><!--[if gte mso 9]><xml>
Normal
0
7.8 磅
0
2
false
false
false
MicrosoftInternetExplorer4
</xml><![endif]--><!--[if gte mso 9]><![endif]--><style>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:""@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Times New Roman";}
/* Page Definitions */
@page
{}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{}
@list l0:level1
{
margin-left:18.0pt;
text-indent:-18.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{
mso-style-parent:"";
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]--><strong><span style="font-size: 16pt; color: rgb(51, 102, 255);"><span>3.<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;
</span></span></span></strong><strong><span style="font-size: 16pt; font-family: 宋体; color: rgb(51, 102, 255);">在</span></strong><strong><span style="font-size: 16pt; color: rgb(51, 102, 255);">res</span></strong><strong><span style="font-size: 16pt; font-family: 宋体; color: rgb(51, 102, 255);">下的</span></strong><strong><span style="font-size: 16pt; color: rgb(51, 102, 255);">txt</span></strong><strong><span style="font-size: 16pt; font-family: 宋体; color: rgb(51, 102, 255);">包下</span></strong><strong><span style="font-size: 16pt; font-family: 宋体; color: rgb(51, 102, 255);">制定副本</span></strong><strong><span style="font-size: 16pt; color: rgb(51, 102, 255);">key-zh.txt</span></strong></p>
<p style="margin-left: 18pt;">name=姓名<br />
submit=提交</p>
<p style="margin-left: 18pt;">以<span style="color: red;">native2ascii -encoding GB2312 app_zh.txt app_zh.properties</span>的方式生成app_zh.properties文件，并复制到res下，此时中文被转码成Unicode码：</p>
<p style="margin-left: 18pt;">name=\u59d3\u540d<br />
submit=\u63d0\u4ea4</p>
<p style="margin-left: 18pt;">以同样的方式制定 key-en.txt（等等等）副本</p>
<p style="margin-left: 18pt;"><img alt="" src="http://www.blogjava.net/images/blogjava_net/crazycoding/s.JPG" /></p>
<p style="margin-left: 18pt;">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 11" />
<meta name="Originator" content="Microsoft Word 11" />
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Csamsung%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" /><!--[if gte mso 9]><xml>
Normal
0
7.8 磅
0
2
false
false
false
MicrosoftInternetExplorer4
</xml><![endif]--><!--[if gte mso 9]><![endif]--><style>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:""@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Times New Roman";}
/* Page Definitions */
@page
{}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{
mso-style-parent:"";
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]-->
</p>
<p><strong><span style="font-size: 16pt; color: rgb(51, 102, 255);">4.</span></strong><strong><span style="font-size: 16pt; font-family: 宋体; color: rgb(51, 102, 255);">将</span></strong><strong><span style="font-size: 16pt; color: rgb(51, 102, 255);">res</span></strong><strong><span style="font-size: 16pt; font-family: 宋体; color: rgb(51, 102, 255);">文件夹编译到</span></strong><strong><span style="font-size: 16pt; color: rgb(51, 102, 255);">classes</span></strong></p>
<p>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 11" />
<meta name="Originator" content="Microsoft Word 11" />
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Csamsung%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" /><!--[if gte mso 9]><xml>
Normal
0
7.8 磅
0
2
false
false
false
MicrosoftInternetExplorer4
</xml><![endif]--><!--[if gte mso 9]><![endif]--><style>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:""@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Times New Roman";}
/* Page Definitions */
@page
{}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{
mso-style-parent:"";
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]--><strong><span style="font-size: 16pt; font-family: &quot;Times New Roman&quot;; color: rgb(51, 102, 255);">5.</span><span style="font-size: 16pt; font-family: 宋体; color: rgb(51, 102, 255);">配置</span><span style="font-size: 16pt; font-family: &quot;Times New Roman&quot;; color: rgb(51, 102, 255);">struts-config.xml</span><span style="font-size: 16pt; font-family: 宋体; color: rgb(51, 102, 255);">文件</span></strong></p>
<p>&nbsp;</p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">message-resources&nbsp;</span><span style="color: rgb(255, 0, 0);">parameter</span><span style="color: rgb(0, 0, 255);">="app"</span><span style="color: rgb(255, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">/&gt;</span></div>
注意：parameter要对应母本文件的前缀——app<br />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 11" />
<meta name="Originator" content="Microsoft Word 11" />
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Csamsung%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" /><!--[if gte mso 9]><xml>
Normal
0
7.8 磅
0
2
false
false
false
MicrosoftInternetExplorer4
</xml><![endif]--><!--[if gte mso 9]><![endif]--><style>
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:""@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Times New Roman";}
/* Page Definitions */
@page
{}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{
mso-style-parent:"";
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]-->
<p><strong><span style="font-size: 16pt; color: rgb(51, 102, 255);">6.</span></strong><strong><span style="font-size: 16pt; font-family: 宋体; color: rgb(51, 102, 255);">重启</span></strong><strong><span style="font-size: 16pt; color: rgb(51, 102, 255);">tomcat</span></strong><strong><span style="font-size: 16pt; font-family: 宋体; color: rgb(51, 102, 255);">，配置成功</span></strong></p>
测试：切换浏览器默认语言（右键浏览器图标---- 语言 -----）<br />
<img alt="" src="http://www.blogjava.net/images/blogjava_net/crazycoding/ss.JPG" width="349" height="286" /><br />
访问项目，查看结果<br />
<p style="margin-left: 18pt;">
</p>
<img src ="http://www.blogjava.net/crazycoding/aggbug/309515.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/crazycoding/" target="_blank">Ying-er</a> 2010-01-14 19:48 <a href="http://www.blogjava.net/crazycoding/archive/2010/01/14/309515.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>