﻿<?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-无线&amp;移动互联网-文章分类-wap 积累</title><link>http://www.blogjava.net/jzone/category/40152.html</link><description>从业互联网、期盼物联网·· 不断的努力、追求，等待时机，相信该来的终究是会来的</description><language>zh-cn</language><lastBuildDate>Mon, 08 Nov 2010 08:50:24 GMT</lastBuildDate><pubDate>Mon, 08 Nov 2010 08:50:24 GMT</pubDate><ttl>60</ttl><item><title>WAP1.0 前端开发经验（原创-JSP）</title><link>http://www.blogjava.net/jzone/articles/337273.html</link><dc:creator>Gavin.lee</dc:creator><author>Gavin.lee</author><pubDate>Thu, 04 Nov 2010 15:44:00 GMT</pubDate><guid>http://www.blogjava.net/jzone/articles/337273.html</guid><wfw:comment>http://www.blogjava.net/jzone/comments/337273.html</wfw:comment><comments>http://www.blogjava.net/jzone/articles/337273.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jzone/comments/commentRss/337273.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jzone/services/trackbacks/337273.html</trackback:ping><description><![CDATA[&nbsp;
<p style="text-indent: 21pt"><span style="font-family: 微软雅黑">在看这些经验总结之前，我强烈的建议无线开发人员及产品人员熟读</span><span style="font-family: 'Courier New'">WML</span><span style="font-family: 微软雅黑">的规范，手册地址：</span></p>
<p style="text-indent: 21pt"><span style="font-family: 'Courier New'"><a href="http://www.w3cschool.cn/index-18.asp.htm">http://www.w3cschool.cn/index-18.asp.htm</a> </span></p>
<p style="text-indent: 21pt"><span style="font-family: 微软雅黑">根据我们长时间开发的积累，我们在使用过程中确实遇到的一些问题，通过这些积累，使得我们找到移动互联网开发的一些规律：</span></p>
<p>1<span style="font-family: 微软雅黑">、我可以在屏幕上显示几行信息？</span></p>
<p style="text-indent: 21pt"><span style="font-family: 微软雅黑">事实上，对显示多少行没有特别限制，只要不超过面板的最大尺寸就行（随设备的不同而不同）。然而，为了避免太多滚屏，每屏（即卡片）</span><span style="font-family: 'Courier New'">5 </span><span style="font-family: 微软雅黑">至</span><span style="font-family: 'Courier New'"> 7 </span><span style="font-family: 微软雅黑">行最佳。</span><span style="font-family: 微软雅黑">当然屏不要太多，</span><span style="font-family: 'Courier New'">3-4</span><span style="font-family: 微软雅黑">屏为极限，因为考虑到目前市场上很多的山寨手机对</span><span style="font-family: 'Courier New'">WML</span><span style="font-family: 微软雅黑">页面大小支持的不好。</span></p>
<p>2<span style="font-family: 微软雅黑">、我们应该权衡</span>GET/POST<span style="font-family: 微软雅黑">哪些问题？</span></p>
<p style="text-indent: 21pt"><span style="font-family: 微软雅黑">在实际开发中，确实遇到一些电话不支持使用</span><span style="font-family: 'Courier New'"> POST </span><span style="font-family: 微软雅黑">方法发送表单数据，这种情况，我们确实没有办法去做兼容了。因为在实际开发中，有些数据我们必须要为用户保密，例如用户名和密码必须通过</span><span style="font-family: 'Courier New'"> POST </span><span style="font-family: 微软雅黑">方法发送。</span></p>
<p style="text-indent: 21pt"><span style="font-family: 微软雅黑">在</span><span style="font-family: 'Courier New'"> WAP </span><span style="font-family: 微软雅黑">网关上，如果日志功能被激活并且请求已被记录，管理员就有能看到用户名和密码。如果网关是由</span><span style="font-family: 'Courier New'"> ISP </span><span style="font-family: 微软雅黑">或其它第三方提供的，这个问题就会特别突出。</span></p>
<p style="text-indent: 21pt"><em><span style="font-family: 微软雅黑">即使一个安全的连接也不能完全消除安全隐患。那些发送到</span></em><em><span style="font-family: 'Courier New'"> WAP </span></em><em><span style="font-family: 微软雅黑">网关的数据使用</span></em><em><span style="font-family: 'Courier New'"> WTLS</span></em><em><span style="font-family: 微软雅黑">（</span></em><em><span style="font-family: 'Courier New'">Wireless Transport Layer Security</span></em><em><span style="font-family: 微软雅黑">）加密，它使用与标准</span></em><em><span style="font-family: 'Courier New'"> TLS </span></em><em><span style="font-family: 微软雅黑">相同的算法。然而，发送到</span></em><em><span style="font-family: 'Courier New'"> WAP </span></em><em><span style="font-family: 微软雅黑">网关的数据是二进制的编码格式（对</span></em><em><span style="font-family: 'Courier New'"> WAP</span></em><em><span style="font-family: 微软雅黑">），所以这些加密后的数据必须用</span></em><em><span style="font-family: 'Courier New'"> TLS </span></em><em><span style="font-family: 微软雅黑">解密和再加密以适用于因特网。经过一段时间以后，敏感数据在</span></em><em><span style="font-family: 'Courier New'"> WAP </span></em><em><span style="font-family: 微软雅黑">网关上以明文的形式出现。黑客则会在适当的时刻，将内存中的信息转储出来，进而成功地访问这些敏感数据。</span></em></p>
<p style="text-indent: 21pt"><em><span style="font-family: 微软雅黑">按照注释，解决该问题的一种办法是在自己公司（而不是在</span></em><em><span style="font-family: 'Courier New'"> ISP</span></em><em><span style="font-family: 微软雅黑">）设一个</span></em><em><span style="font-family: 'Courier New'"> WAP </span></em><em><span style="font-family: 微软雅黑">网关。在这种情况下，一个可信的人可以操作网关，并且可以关闭日志功能。</span></em></p>
<p style="text-indent: 21pt"><em><span style="font-family: 微软雅黑">您也可以用</span></em><em><span style="font-family: 'Courier New'"> WMLScript </span></em><em><span style="font-family: 微软雅黑">来编写自定义的加密算法，以对客户端的用户名和密码进行加密。这只有在使用简单的算法时才有可能实现；在支持</span></em><em><span style="font-family: 'Courier New'"> DES </span></em><em><span style="font-family: 微软雅黑">类的算法上，</span></em><em><span style="font-family: 'Courier New'">WMLScript </span></em><em><span style="font-family: 微软雅黑">不够强大。虽然有这么多的顾虑。</span></em></p>
<p style="text-indent: 21pt"><span style="font-family: 微软雅黑">我们在实际的开发中选择的依然首选的是</span><span style="font-family: 'Courier New'">GET</span><span style="font-family: 微软雅黑">。我们建议使用</span><span style="font-family: 'Courier New'">GET</span><span style="font-family: 微软雅黑">方式提交参数，是考虑到</span><span style="font-family: 'Courier New'">URL</span><span style="font-family: 微软雅黑">可移植、保证参数完整，但是同时我们为了保密、限长度可以在合适的地方（用户保密数据、参数可能出现过长）应用</span><span style="font-family: 'Courier New'">POST</span><span style="font-family: 微软雅黑">。</span></p>
<p>3<span style="font-family: 微软雅黑">、我怎样保持</span> Session<span style="font-family: 微软雅黑">？</span></p>
<p style="text-indent: 21pt"><span style="font-family: 微软雅黑">我们再做任何一个模块设计的时候都不要假设手机终端都支持</span><span style="font-family: 'Courier New'">cookie(</span><span style="font-family: 微软雅黑">虽然部分手机支持</span><span style="font-family: 'Courier New'">cookie</span><span style="font-family: 微软雅黑">，但不能保证用户都开启</span><span style="font-family: 'Courier New'">cookie)</span><span style="font-family: 微软雅黑">。这样，当用户在您的站点的不同页面之间穿梭时，为了在服务器端保留关于客户端的信息，在向服务器发送每个请求的同时，一个</span><span style="font-family: 'Courier New'"> Session ID </span><span style="font-family: 微软雅黑">必须被当作参数传递。</span><span style="font-family: 'Courier New'">Session ID </span><span style="font-family: 微软雅黑">的参数名根据</span><span style="font-family: 'Courier New'"> Servlet </span><span style="font-family: 微软雅黑">引擎的不同而不同。</span></p>
<p style="text-indent: 21pt"><span style="font-family: 微软雅黑">有时，缺省的</span><span style="font-family: 'Courier New'"> Session ID </span><span style="font-family: 微软雅黑">长度很大幅度地增加了每个请求的长度。结果导致客户端或</span><span style="font-family: 'Courier New'"> WAP </span><span style="font-family: 微软雅黑">网关可能将此请求看作一个无效的</span><span style="font-family: 'Courier New'"> URL </span><span style="font-family: 微软雅黑">而拒绝。这样有必要缩短</span><span style="font-family: 'Courier New'"> Session ID </span><span style="font-family: 微软雅黑">的长度。可自定义一些所短</span><span style="font-family: 'Courier New'">sessionID</span><span style="font-family: 微软雅黑">长度的方案。</span></p>
<p>4<span style="font-family: 微软雅黑">、</span>Select <span style="font-family: 微软雅黑">框参数的提交？</span></p>
<p style="text-indent: 21pt"><span style="font-family: 微软雅黑">因为</span><span style="font-family: 'Courier New'">WAP</span><span style="font-family: 微软雅黑">浏览器的简陋、多而杂，在不同的浏览器里，</span><span style="font-family: 'Courier New'">select</span><span style="font-family: 微软雅黑">提交被截获的参数值也是不同的，如在</span><span style="font-family: 'Courier New'">select</span><span style="font-family: 微软雅黑">中，你选中了</span><span style="font-family: 'Courier New'">1/2/3</span><span style="font-family: 微软雅黑">提交后，截取的值，可能是</span><span style="font-family: 'Courier New'">1,2,3</span><span style="font-family: 微软雅黑">，也可能是</span><span style="font-family: 'Courier New'">1</span><span style="font-family: 微软雅黑">；</span><span style="font-family: 'Courier New'">2</span><span style="font-family: 微软雅黑">；</span><span style="font-family: 'Courier New'">3</span><span style="font-family: 微软雅黑">。</span></p>
<p style="text-indent: 21pt"><span style="font-family: 微软雅黑">这点跟</span><span style="font-family: 'Courier New'">WEB</span><span style="font-family: 微软雅黑">上有些许差异，请大家多注意</span></p>
<p>5<span style="font-family: 微软雅黑">、参数简单化？</span></p>
<p style="text-indent: 21pt"><span style="font-family: 微软雅黑">在开发过程中，我们经常是为了页面参数提交的简单，即为了减少参数的提交个数，我们喜欢在</span><span style="font-family: 'Courier New'">WML</span><span style="font-family: 微软雅黑">页面对一些参数进行拼装。如下：</span></p>
<p><span style="font-family: 'Courier New'">&lt;postfield name="content" value="$(bwBall)~$(swBall)~$(gwBall)"/&gt;</span><span style="font-family: 微软雅黑">，实际操作中，我们应该避免这样的参数拼装，仅管在</span><span style="font-family: 'Courier New'">WAP1.1</span><span style="font-family: 微软雅黑">之后确实支持一些分割符的分隔</span></p>
<p>6<span style="font-family: 微软雅黑">、编码问题同样是个诟病？</span></p>
<p style="text-indent: 21pt"><span style="font-family: 微软雅黑">无论我们在</span><span style="font-family: 'Courier New'">J2EE/J2SE</span><span style="font-family: 微软雅黑">开发过程中，都会遇到编码的问题，不同的是</span><span style="font-family: 'Courier New'">WML</span><span style="font-family: 微软雅黑">中遇到的编码问题大多数并不是我们服务端导致的，手机厂商对编码没有固定的设置，很多用户不会去关心手机的编码，在参数提交时如果带有中文参数，在参数接收时，就需要对参数进行处理，因为客户端提交过来的可以是</span><span style="font-family: 'Courier New'">ASCII</span><span style="font-family: 微软雅黑">码</span></p>
<p>7<span style="font-family: 微软雅黑">、&#8220;内部服务器错误&#8221;？</span></p>
<p style="text-indent: 21pt"><span style="font-family: 微软雅黑">如果做</span><span style="font-family: 'Courier New'">WML</span><span style="font-family: 微软雅黑">开发你没遇到过这类错误，那你绝对不是一个称职的开发。在手机中报这类错误，基本上都属于功能机，对应的</span><span style="font-family: 'Courier New'"> response code </span><span style="font-family: 微软雅黑">是</span><span style="font-family: 'Courier New'">500</span><span style="font-family: 微软雅黑">。</span></p>
<p>8<span style="font-family: 微软雅黑">、</span>WML<span style="font-family: 微软雅黑">页面对图片的支持度？</span></p>
<p style="text-indent: 21pt"><span style="font-family: 微软雅黑">在</span><span style="font-family: 'Courier New'">WML</span><span style="font-family: 微软雅黑">页面里，图片是不被建议的，如果非要使用的话，请注意图片不要多于</span><span style="font-family: 'Courier New'">5</span><span style="font-family: 微软雅黑">张，图片最好要经过处理，越小越好。另外图片的格式最好是</span><span style="font-family: 'Courier New'">PNG</span><span style="font-family: 微软雅黑">，如果有条件的话</span><span style="font-family: 'Courier New'">PNG</span><span style="font-family: 微软雅黑">、</span><span style="font-family: 'Courier New'">GIF</span><span style="font-family: 微软雅黑">、</span><span style="font-family: 'Courier New'">JPG</span><span style="font-family: 微软雅黑">最好都备上。</span></p>
<p>9<span style="font-family: 微软雅黑">、转义字符的使用？</span></p>
<p><span style="font-family: 微软雅黑">在</span><span style="font-family: 'Courier New'">WML</span><span style="font-family: 微软雅黑">中，跟</span><span style="font-family: 'Courier New'">HDML</span><span style="font-family: 微软雅黑">一样，多个连续的空格只显示一个空格；在</span><span style="font-family: 'Courier New'">WML</span><span style="font-family: 微软雅黑">中，一定要注意使用转义字符，如：</span></p>
<p><span style="font-family: 'Courier New'">&lt; &nbsp;&nbsp;&nbsp;&nbsp; -----&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;lt;</span></p>
<p><span style="font-family: 'Courier New'">&gt; &nbsp;&nbsp;&nbsp;&nbsp; -----&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;gt;</span></p>
<p><span style="font-family: 微软雅黑">&#8216;</span><span style="font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -----&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;apos;</span></p>
<p><span style="font-family: 微软雅黑">&#8220;</span><span style="font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -----&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;quot;</span></p>
<p><span style="font-family: 'Courier New'">&amp; &nbsp;&nbsp;&nbsp;&nbsp; -----&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;amp;</span></p>
<p><span style="font-family: 'Courier New'">$ &nbsp;&nbsp;&nbsp;&nbsp; -----&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $$</span></p>
<p><span style="font-family: 微软雅黑">空格</span><span style="font-family: 'Courier New'"> &nbsp;&nbsp; -----&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;nbsp;</span></p>
<p><span style="font-family: 'Courier New'">-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -----&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;shy;</span></p>
<p><span style="font-family: 微软雅黑">特别是在</span><span style="font-family: 'Courier New'">URL</span><span style="font-family: 微软雅黑">参数传递过程中，源码中</span><span style="font-family: 'Courier New'">&amp;</span><span style="font-family: 微软雅黑">必须写成</span><span style="font-family: 'Courier New'">&amp;amp</span><span style="font-family: 'Courier New'">;</span></p>
<p>10<span style="font-family: 微软雅黑">、一个标准的</span>crad<span style="font-family: 微软雅黑">？</span></p>
<p><span style="font-family: 'Courier New'">card</span><span style="font-family: 微软雅黑">是</span><span style="font-family: 'Courier New'">WML</span><span style="font-family: 微软雅黑">的单元，由此，我们可以知道一个</span><span style="font-family: 'Courier New'">WML</span><span style="font-family: 微软雅黑">页面可以有多个</span><span style="font-family: 'Courier New'">card</span><span style="font-family: 微软雅黑">（静态文字预加载推荐使用）。</span></p>
<p><span style="font-family: 微软雅黑">如下是一个</span><span style="font-family: 'Courier New'">WML</span><span style="font-family: 微软雅黑">最基本的元素：</span></p>
<p><span style="font-family: 'Courier New'">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" </span></p>
<p style="margin-left: 147pt; text-indent: 21pt"><span style="font-family: 'Courier New'">"http://www.wapforum.org/DTD/wml_1.1.xml"&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;wml&gt; </span></p>
<p><span style="font-family: 'Courier New'">&nbsp;&nbsp;&nbsp; &lt;head&gt;</span></p>
<p><span style="font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;meta forua="true" http-equiv="Cache-Control" content="max-age=0"/&gt;</span></p>
<p><span style="font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;meta forua="true" http-equiv="Cache-Control" content="no-cache"/&gt;</span></p>
<p><span style="font-family: 'Courier New'">&nbsp;&nbsp;&nbsp; &lt;/head&gt; </span></p>
<p><span style="font-family: 'Courier New'">&nbsp;&nbsp;&nbsp; &lt;card id="index" title="</span><span style="font-family: 微软雅黑">爱彩票</span><span style="font-family: 'Courier New'">"&gt;</span></p>
<p><span style="font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;p&gt;</span><span style="font-family: 微软雅黑">内容</span><span style="font-family: 'Courier New'">&lt;/p&gt;</span></p>
<p><span style="font-family: 'Courier New'">&nbsp;&nbsp;&nbsp; &lt;/card&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;/wml&gt;</span></p>
<p>11<span style="font-family: 微软雅黑">、关于</span>WML<span style="font-family: 微软雅黑">页面的表单参数提交</span>&lt;anchor&gt;<span style="font-family: 微软雅黑">？</span></p>
<p><span style="font-family: 微软雅黑">有一个标准的表单提交的实例：</span></p>
<p><span style="font-family: 微软雅黑">源码：</span></p>
<p><span style="font-family: 'Courier New'">&lt;img src="http://wap.baidu.com/logo.gif" alt="Baidu"/&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;input name="word" size="4"/&gt;&lt;br/&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;anchor&gt;</span></p>
<p><span style="font-family: 'Courier New'">&#x641C;&#x7F51;&#x9875;</span></p>
<p><span style="font-family: 'Courier New'">&lt;go href="http://wap.baidu.com/baidu" method="get"&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;postfield name="word" value="$(word)"/&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;postfield name="tn" value="wisewml"/&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;postfield name="rn" value="5"/&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;postfield name="ie" value="unicode"/&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;postfield name="cl" value="2"/&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;postfield name="vit" value="uni"/&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;postfield name="from" value="578b_w1"/&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;/go&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;/anchor&gt;|</span></p>
<p><span style="font-family: 'Courier New'">&lt;anchor&gt;</span></p>
<p><span style="font-family: 'Courier New'">&#x8FDB;&#x8D34;&#x5427;</span></p>
<p><span style="font-family: 'Courier New'">&lt;go href="http://wapp.baidu.com/f" method="get"&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;postfield name="kw" value="$(word)"/&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;postfield name="from" value="578b_w2"/&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;postfield name="inb" value="1"/&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;/go&gt;</span></p>
<p><span style="font-family: 'Courier New'">&lt;/anchor&gt;</span></p>
<p><span style="font-family: 微软雅黑">在这里有个很好的体现，提交文字所在的位置，这个问题，针对小部分手机会有差异（会产生页面解析失败的情况）。我们最好的习惯是将提交文字写在</span><span style="font-family: 'Courier New'">&lt;anchor&gt;</span><span style="font-family: 微软雅黑">与</span><span style="font-family: 'Courier New'">&lt;go href=&#8221;&#8221; method=&#8221;get&#8221;&gt;</span><span style="font-family: 微软雅黑">之间。</span></p>
<p>12<span style="font-family: 微软雅黑">、</span>WAP<span style="font-family: 微软雅黑">如何保证表现层可维护性？</span></p>
<p style="text-indent: 21pt"><span style="font-family: 微软雅黑">这可能是最可怕的事情了，由于</span><span style="font-family: 'Courier New'">WAP</span><span style="font-family: 微软雅黑">业务的特殊性，合作推广相对</span><span style="font-family: 'Courier New'">WAP</span><span style="font-family: 微软雅黑">较频繁，如果系统开发人员没有一个好的思想，好的编程习惯，喜欢将代码粘来粘去（特别是页面代码），时间长了，这将给系统带来毁灭性的结局。</span></p>
<p>13<span style="font-family: 微软雅黑">、低端机对</span>WML<span style="font-family: 微软雅黑">标签的支持？</span></p>
<p style="text-indent: 21pt"><span style="font-family: 微软雅黑">移动终端，大家要清楚的就是这是个以简洁为主的地盘，无论从业务上还是从技术上，</span><span style="font-family: 'Courier New'">WEB</span><span style="font-family: 微软雅黑">人员都喜欢将</span><span style="font-family: 'Courier New'">WEB</span><span style="font-family: 微软雅黑">的一套模式照搬到</span><span style="font-family: 'Courier New'">WAP</span><span style="font-family: 微软雅黑">中来，如果你真的那样做的话，我要告诉你，你会死的很惨，很多</span><span style="font-family: 'Courier New'">WEB</span><span style="font-family: 微软雅黑">上的业务是跟</span><span style="font-family: 'Courier New'">WAP</span><span style="font-family: 微软雅黑">的用户群的截然不同的，那么从技术上来说，也是不能通用的。</span></p>
<p><span style="font-family: 微软雅黑">特别是低端机，很多好的效果，好的模式都是不支持的，所以说这是个简单的平台。</span></p>
<p><span style="font-family: 微软雅黑">举例：在</span><span style="font-family: 'Courier New'">html</span><span style="font-family: 微软雅黑">页面我们会用各种颜色，各种字体，想方设法的让展示更炫，</span><span style="font-family: 'Courier New'">WAP</span><span style="font-family: 微软雅黑">行不通的，如下标签就不能通过</span><span style="font-family: 'Courier New'">---</span><span style="font-family: 微软雅黑">一般手机会报：<strong>内容格式错误</strong></span></p>
<p><span style="font-family: 'Courier New'">&lt;b&gt;</span><span style="font-family: 微软雅黑">粗体</span><span style="font-family: 'Courier New'">&lt;/b&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---------</span><span style="font-family: 微软雅黑">低端机不支持</span></p>
<p><span style="font-family: 'Courier New'">&lt;i&gt;</span><span style="font-family: 微软雅黑">斜体</span><span style="font-family: 'Courier New'">&lt;/i&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---------</span><span style="font-family: 微软雅黑">低端机不支持</span></p>
<p><span style="font-family: 'Courier New'">&lt;img alt="pic" src="" /&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---------</span><span style="font-family: 微软雅黑">在使用</span><span style="font-family: 'Courier New'">img</span><span style="font-family: 微软雅黑">标签时，</span><span style="font-family: 'Courier New'">alt</span><span style="font-family: 微软雅黑">标签必填</span></p>
<p><span style="font-family: 微软雅黑">如果你想你的应用以展现为主，那么有些丰富页面的标签你可以尝试一下，如果你的平台是电子商务，那么我奉劝产品及开发人员，这些标签你还是离它们远点。</span></p>
<p>14<span style="font-family: 微软雅黑">、如何去除</span>WAP<span style="font-family: 微软雅黑">页面输入框缓存？</span></p>
<p style="text-indent: 21pt"><span style="font-family: 微软雅黑">在</span><span style="font-family: 'Courier New'">WAP</span><span style="font-family: 微软雅黑">页面输入框的缓存是让用户感到很头疼的东西，很多时候我们第二次访问同一个输入框是想重新输入值的，结果页面响应给我们的框里却遗留了上一次输入的值。还需要手动的删除上一次数据再重新输入数据。从这个操作上来说让用户体验很不流畅，或者说给用户使用带来了阻力。</span></p>
<p><span style="font-family: 'Courier New'">&nbsp;&nbsp;&nbsp; </span><span style="font-family: 微软雅黑">为了规避这种输入框缓存，我们可以利用随机数，如参数</span><span style="font-family: 'Courier New'">param</span><span style="font-family: 微软雅黑">我们可以写成</span><span style="font-family: 'Courier New'"> param + random</span></p>
<p>15<span style="font-family: 微软雅黑">、部分手机对下拉框的支持度？</span></p>
<p style="text-indent: 21pt"><span style="font-family: 微软雅黑">在开发过程中，我们遇到一些奇怪的问题，在</span><span style="font-family: 'Courier New'">WAP1.0</span><span style="font-family: 微软雅黑">的手机里，有些低端的手机不支持下拉框的定号选择。如：</span></p>
<p style="margin-left: 21pt; text-indent: 21pt; text-align: left" align="left"><span style="color: teal; font-family: 'Courier New'">&lt;</span><span style="background: silver; color: #3f7f7f; font-family: 'Courier New'">select</span><span style="font-family: 'Courier New'"> <span style="color: #7f007f">name</span><span style="color: black">=</span><em><span style="color: #2a00ff">'params'</span></em><span style="color: teal">&gt;</span></span></p>
<p style="text-align: left" align="left"><span style="color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: teal; font-family: 'Courier New'">&lt;</span><span style="color: #3f7f7f; font-family: 'Courier New'">option</span><span style="font-family: 'Courier New'"> <span style="color: #7f007f">value</span><span style="color: black">=</span><em><span style="color: #2a00ff">'1'</span></em><span style="color: teal">&gt;</span><span style="color: black">value1</span><span style="color: teal">&lt;/</span><span style="color: #3f7f7f">option</span><span style="color: teal">&gt;</span></span></p>
<p style="text-align: left" align="left"><span style="color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: teal; font-family: 'Courier New'">&lt;</span><span style="color: #3f7f7f; font-family: 'Courier New'">option</span><span style="font-family: 'Courier New'"> <span style="color: #7f007f">value</span><span style="color: black">=</span><em><span style="color: #2a00ff">'3'</span></em><span style="color: teal">&gt;</span><span style="color: black">value3</span><span style="color: teal">&lt;/</span><span style="color: #3f7f7f">option</span><span style="color: teal">&gt;</span></span></p>
<p style="text-align: left" align="left"><span style="color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: teal; font-family: 'Courier New'">&lt;</span><span style="color: #3f7f7f; font-family: 'Courier New'">option</span><span style="font-family: 'Courier New'"> <span style="color: #7f007f">value</span><span style="color: black">=</span><em><span style="color: #2a00ff">'5'</span></em><span style="color: teal">&gt;</span><span style="color: black">value5</span><span style="color: teal">&lt;/</span><span style="color: #3f7f7f">option</span><span style="color: teal">&gt;</span></span></p>
<p style="text-align: left" align="left"><span style="color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: teal; font-family: 'Courier New'">&lt;</span><span style="color: #3f7f7f; font-family: 'Courier New'">option</span><span style="font-family: 'Courier New'"> <span style="color: #7f007f">value</span><span style="color: black">=</span><em><span style="color: #2a00ff">'7'</span></em><span style="color: teal">&gt;</span><span style="color: black">value7</span><span style="color: teal">&lt;/</span><span style="color: #3f7f7f">option</span><span style="color: teal">&gt;</span></span></p>
<p style="text-align: left" align="left"><span style="color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: teal; font-family: 'Courier New'">&lt;</span><span style="color: #3f7f7f; font-family: 'Courier New'">option</span><span style="font-family: 'Courier New'"> <span style="color: #7f007f">value</span><span style="color: black">=</span><em><span style="color: #2a00ff">'9'</span></em><span style="color: teal">&gt;</span><span style="color: black">value9</span><span style="color: teal">&lt;/</span><span style="color: #3f7f7f">option</span><span style="color: teal">&gt;</span></span></p>
<p><span style="color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: teal; font-family: 'Courier New'">&lt;/</span><span style="background: silver; color: #3f7f7f; font-family: 'Courier New'">select</span><span style="color: teal; font-family: 'Courier New'">&gt;&lt;</span><span style="color: #3f7f7f; font-family: 'Courier New'">br</span><span style="color: teal; font-family: 'Courier New'">/&gt;</span></p>
<p><span style="color: black; font-family: 微软雅黑">原本我们是希望用户选择的是3，则我们接受到的也是3，可是不幸的是，我们接收到的是1，通过多次的查日志验证，确实有这样的情况存在，即：该类型的手机下拉框全部是按照升序的值进行传递的。那么在我们这个事例的值就是，0,1,2,3,4而不是1,3,5,7,9。</span></p>
<p>16<span style="font-family: 微软雅黑">、部分手机对复选框的支持？</span></p>
<p style="text-indent: 21pt"><span style="color: black; font-family: 微软雅黑">这个特性需要产品设计人员注意了，在产品设计的时候尽量避免这些复选的出现。因为在出现复选框的时候，部分手机是会默认全选的（如MOTO手机）。</span></p>
 <img src ="http://www.blogjava.net/jzone/aggbug/337273.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jzone/" target="_blank">Gavin.lee</a> 2010-11-04 23:44 <a href="http://www.blogjava.net/jzone/articles/337273.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>让你的PC也能访问手机腾讯网</title><link>http://www.blogjava.net/jzone/articles/337244.html</link><dc:creator>Gavin.lee</dc:creator><author>Gavin.lee</author><pubDate>Thu, 04 Nov 2010 07:58:00 GMT</pubDate><guid>http://www.blogjava.net/jzone/articles/337244.html</guid><wfw:comment>http://www.blogjava.net/jzone/comments/337244.html</wfw:comment><comments>http://www.blogjava.net/jzone/articles/337244.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jzone/comments/commentRss/337244.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jzone/services/trackbacks/337244.html</trackback:ping><description><![CDATA[<p style="font-family: 微软雅黑">以前就用过的方法，时间长了不使用就容易忘掉，觉得写下来还是有必要的，以备查用。<br />
<br />
手机腾讯网一般用PC浏览器不能访问的是因为程序对浏览器的UA进行判断过滤，知道这个原理后，我就来给我们的UA制造假象，都说了，大活人难道还能被屎尿憋死。<br />
<br />
以下做法，一般用户一般没这个需求吧，呵呵~~<br />
因为工作需要，经常要看各大门户的WAP站，可是QQ手机腾讯网在PC上又无法访问，无奈用手机，那你就OUT了，下面介绍个用Firefox访问手机腾讯网的办法：<br />
<br />
1、网上搜索插件：wmlbrowser + user-agent-switcher<br />
&nbsp;&nbsp;&nbsp;&nbsp;下到这两个插件后，直接将插件拖到FF页面就OK<br />
&nbsp;&nbsp;&nbsp;&nbsp;wmlbrowser：<a href="https://addons.mozilla.org/zh-CN/firefox/addon/62/">https://addons.mozilla.org/zh-CN/firefox/addon/62/</a> <br />
&nbsp;&nbsp;&nbsp;&nbsp;user-agent-switcher：<a href="https://addons.mozilla.org/zh-CN/firefox/addon/59/">https://addons.mozilla.org/zh-CN/firefox/addon/59/</a>&nbsp;&nbsp;&nbsp;<br />
2、扩展user-agent<br />
&nbsp;&nbsp;&nbsp;&nbsp;安装完wmlbrowser插件后，你的FF就可以访问一般的WAP站了，不过手机腾讯网还是不能访问，这时候user-agent派上用场了，&#8220;工具-default user agent&#8221; 切换到iphone或者其他，然后你再试试，OL&#183;&#183; :-)<br />
&nbsp;&nbsp;&nbsp;&nbsp;如果你嫌这些UA不够多，或者你想换其他的UA，自己可以编辑，或者直接导入UA，同样网上搜索user-agents-fisio.cn.xml，下载到这个xml后，可以直接在FF中导入，然后就OK了，你想换什么UA就换什么UA<br />
3、完成后，重启你的FF，畅游手机腾讯网吧。<br />
<br />
顺便谴责一下腾讯，这段时间腾讯跟奇虎360口水架吵的比较猛，做为一个互联网的老大，应该拿出老大的气魄 -- <a href="http://t.sina.com.cn/2moving">@爱彩票生活</a></p><img src ="http://www.blogjava.net/jzone/aggbug/337244.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jzone/" target="_blank">Gavin.lee</a> 2010-11-04 15:58 <a href="http://www.blogjava.net/jzone/articles/337244.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Openwave 7.0 显示中文解决方案</title><link>http://www.blogjava.net/jzone/articles/321738.html</link><dc:creator>Gavin.lee</dc:creator><author>Gavin.lee</author><pubDate>Mon, 24 May 2010 07:52:00 GMT</pubDate><guid>http://www.blogjava.net/jzone/articles/321738.html</guid><wfw:comment>http://www.blogjava.net/jzone/comments/321738.html</wfw:comment><comments>http://www.blogjava.net/jzone/articles/321738.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jzone/comments/commentRss/321738.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jzone/services/trackbacks/321738.html</trackback:ping><description><![CDATA[这做wap 测试的时候，用Openwave 7.0显示的网页则是乱码的<br />
<br />
我的解决方法是：<br />
<br />
在模拟器中Settings-&gt;Device Properties中的Font,在Default Font中填入STXinwei.ttf
<img src ="http://www.blogjava.net/jzone/aggbug/321738.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jzone/" target="_blank">Gavin.lee</a> 2010-05-24 15:52 <a href="http://www.blogjava.net/jzone/articles/321738.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>WML 语言 标签学习</title><link>http://www.blogjava.net/jzone/articles/311149.html</link><dc:creator>Gavin.lee</dc:creator><author>Gavin.lee</author><pubDate>Thu, 28 Jan 2010 15:18:00 GMT</pubDate><guid>http://www.blogjava.net/jzone/articles/311149.html</guid><wfw:comment>http://www.blogjava.net/jzone/comments/311149.html</wfw:comment><comments>http://www.blogjava.net/jzone/articles/311149.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jzone/comments/commentRss/311149.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jzone/services/trackbacks/311149.html</trackback:ping><description><![CDATA[<a href="http://www.w3school.com.cn/wap/wml_reference.asp">http://www.w3school.com.cn/wap/wml_reference.asp</a> 
<img src ="http://www.blogjava.net/jzone/aggbug/311149.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jzone/" target="_blank">Gavin.lee</a> 2010-01-28 23:18 <a href="http://www.blogjava.net/jzone/articles/311149.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>WAP中利用Cookie保留登录框的用户名</title><link>http://www.blogjava.net/jzone/articles/311145.html</link><dc:creator>Gavin.lee</dc:creator><author>Gavin.lee</author><pubDate>Thu, 28 Jan 2010 14:41:00 GMT</pubDate><guid>http://www.blogjava.net/jzone/articles/311145.html</guid><wfw:comment>http://www.blogjava.net/jzone/comments/311145.html</wfw:comment><comments>http://www.blogjava.net/jzone/articles/311145.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jzone/comments/commentRss/311145.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jzone/services/trackbacks/311145.html</trackback:ping><description><![CDATA[为了方便WAP用户，在登录时需要保留用户名，为下次用户登录时候使用随即用Cookie保留了用户名参数。<br />
<br />
表单接收参数，将其置入Cookie<br />
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img id="Codehighlighter1_3_166_Open_Image" onclick="this.style.display='none'; Codehighlighter1_3_166_Open_Text.style.display='none'; Codehighlighter1_3_166_Closed_Image.style.display='inline'; Codehighlighter1_3_166_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_3_166_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_3_166_Closed_Text.style.display='none'; Codehighlighter1_3_166_Open_Image.style.display='inline'; Codehighlighter1_3_166_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" /><span style="color: #0000ff">try</span><span id="Codehighlighter1_3_166_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_3_166_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cookie&nbsp;cookie&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;Cookie(</span><span style="color: #000000">"</span><span style="color: #000000">username</span><span style="color: #000000">"</span><span style="color: #000000">,&nbsp;URLEncoder.encode(tuser,</span><span style="color: #000000">"</span><span style="color: #000000">utf-8</span><span style="color: #000000">"</span><span style="color: #000000">));<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookie.setMaxAge(</span><span style="color: #000000">60</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">*</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">60</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">*</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">24</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">*</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">30</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">*</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">2</span><span style="color: #000000">);&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">用户名保留2个月</span><span style="color: #008000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" /></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response.addCookie(cookie);<br />
<img id="Codehighlighter1_186_213_Open_Image" onclick="this.style.display='none'; Codehighlighter1_186_213_Open_Text.style.display='none'; Codehighlighter1_186_213_Closed_Image.style.display='inline'; Codehighlighter1_186_213_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_186_213_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_186_213_Closed_Text.style.display='none'; Codehighlighter1_186_213_Open_Image.style.display='inline'; Codehighlighter1_186_213_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #0000ff">catch</span><span style="color: #000000">(Exception&nbsp;ex)</span><span id="Codehighlighter1_186_213_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_186_213_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ex.printStackTrace();<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></div>
<br />
再次走登录流程时，先获取Cookie中的该参数，参数任然有效时，直接取出<br />
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img id="Codehighlighter1_3_262_Open_Image" onclick="this.style.display='none'; Codehighlighter1_3_262_Open_Text.style.display='none'; Codehighlighter1_3_262_Closed_Image.style.display='inline'; Codehighlighter1_3_262_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_3_262_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_3_262_Closed_Text.style.display='none'; Codehighlighter1_3_262_Open_Image.style.display='inline'; Codehighlighter1_3_262_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" /><span style="color: #0000ff">try</span><span id="Codehighlighter1_3_262_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_3_262_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cookie[]&nbsp;cookies&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;request.getCookies();<br />
<img id="Codehighlighter1_69_259_Open_Image" onclick="this.style.display='none'; Codehighlighter1_69_259_Open_Text.style.display='none'; Codehighlighter1_69_259_Closed_Image.style.display='inline'; Codehighlighter1_69_259_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_69_259_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_69_259_Closed_Text.style.display='none'; Codehighlighter1_69_259_Open_Image.style.display='inline'; Codehighlighter1_69_259_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(cookies&nbsp;</span><span style="color: #000000">!=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">null</span><span style="color: #000000">)</span><span id="Codehighlighter1_69_259_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_69_259_Open_Text"><span style="color: #000000">{</span><span style="color: #008000">//</span><span style="color: #008000">取用户登录名</span><span style="color: #008000"><br />
<img id="Codehighlighter1_121_255_Open_Image" onclick="this.style.display='none'; Codehighlighter1_121_255_Open_Text.style.display='none'; Codehighlighter1_121_255_Closed_Image.style.display='inline'; Codehighlighter1_121_255_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_121_255_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_121_255_Closed_Text.style.display='none'; Codehighlighter1_121_255_Open_Image.style.display='inline'; Codehighlighter1_121_255_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" /></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;i&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">0</span><span style="color: #000000">;&nbsp;i&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">&nbsp;cookies.length;&nbsp;i</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span id="Codehighlighter1_121_255_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_121_255_Open_Text"><span style="color: #000000">{<br />
<img id="Codehighlighter1_170_250_Open_Image" onclick="this.style.display='none'; Codehighlighter1_170_250_Open_Text.style.display='none'; Codehighlighter1_170_250_Closed_Image.style.display='inline'; Codehighlighter1_170_250_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_170_250_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_170_250_Closed_Text.style.display='none'; Codehighlighter1_170_250_Open_Image.style.display='inline'; Codehighlighter1_170_250_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.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">if</span><span style="color: #000000">(cookies[i].getName().equals(</span><span style="color: #000000">"</span><span style="color: #000000">username</span><span style="color: #000000">"</span><span style="color: #000000">))</span><span id="Codehighlighter1_170_250_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_170_250_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;username&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;URLDecoder.decode(cookies[i].getValue(),&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">utf-8</span><span style="color: #000000">"</span><span style="color: #000000">);<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
<img id="Codehighlighter1_281_307_Open_Image" onclick="this.style.display='none'; Codehighlighter1_281_307_Open_Text.style.display='none'; Codehighlighter1_281_307_Closed_Image.style.display='inline'; Codehighlighter1_281_307_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_281_307_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_281_307_Closed_Text.style.display='none'; Codehighlighter1_281_307_Open_Image.style.display='inline'; Codehighlighter1_281_307_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #0000ff">catch</span><span style="color: #000000">(Exception&nbsp;e)</span><span id="Codehighlighter1_281_307_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_281_307_Open_Text"><span style="color: #000000">{<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></div>
<br />
Cookie还有很多唯妙的用法，可以指定设置的路径，格式，甚至安全性高的数据，可以通过加密保留。用Cookie也可完成保留用户登录状态的设置。<br />
<br />
注：以下是一位网友对利用Cookie保留登录状态的实现步骤：<br />
１、用户输入网站地址，在jsp页面载入的过程中，读取用户的cookie，如果存在相应的cookie，则建立用户USERINFO，存放在session中，直接进入公告页面； <br />
２、在１中，如果不存在相应的cookie，则显示登录页面，让用户输入自己的用户名和密码，并提供用户保存密码的复选框； <br />
３、如果是合法用户，并选中了保存密码（记住我），则将用户信息写入cookie中,并同时保存在USERINFO中，进入公告页面； <br />
４、如果不是合法用户，则给出提示信息，让其重新输入用户名或密码； <br />
５、如果选中游客登录，则以游客方式进入网站； <br />
６、用户直接输入某个页面的URL，在相应的action中读取用户的cookie，如果存在相应的cookie，则建立用户USERINFO，存放在session中，进入请求的页面； <br />
７、在６中，如果不存在相应的cookie，则以游客身份进入，建立游客用户USERINFO，存放在session中，进入请求的页面； <br />
８、用户选择重新登录，首先检测是否存在相应的cookie，有就先删除cookie，然后回到登录页面重新登录；
<img src ="http://www.blogjava.net/jzone/aggbug/311145.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jzone/" target="_blank">Gavin.lee</a> 2010-01-28 22:41 <a href="http://www.blogjava.net/jzone/articles/311145.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Can't sendRedirect() after data has committed to the client.</title><link>http://www.blogjava.net/jzone/articles/286808.html</link><dc:creator>Gavin.lee</dc:creator><author>Gavin.lee</author><pubDate>Wed, 15 Jul 2009 03:11:00 GMT</pubDate><guid>http://www.blogjava.net/jzone/articles/286808.html</guid><wfw:comment>http://www.blogjava.net/jzone/comments/286808.html</wfw:comment><comments>http://www.blogjava.net/jzone/articles/286808.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jzone/comments/commentRss/286808.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jzone/services/trackbacks/286808.html</trackback:ping><description><![CDATA[[11:04:33.250] java.lang.IllegalStateException: Can't sendRedirect() after data has committed to the client.<br />
[11:04:33.250] &nbsp;at com.caucho.server.connection.AbstractHttpResponse.sendRedirect(AbstractHttpResponse.java:567)<br />
[11:04:33.250] &nbsp;at javax.servlet.http.HttpServletResponseWrapper.sendRedirect(HttpServletResponseWrapper.java:109)<br />
[11:04:33.250] &nbsp;at com.caucho.server.connection.ResponseWrapper.sendRedirect(ResponseWrapper.java:276)<br />
[11:04:33.250] &nbsp;at com.caucho.server.connection.ResponseAdapter.sendRedirect(ResponseAdapter.java:157)<br />
[11:04:33.250] &nbsp;at yixun.wap.tools.GetRequest.ToPage(GetRequest.java:76)<br />
[11:04:33.250] &nbsp;at _jsp._page._user._login._userlogindo__jsp._jspService(_userlogindo__jsp.java:90)<br />
[11:04:33.250] &nbsp;at com.caucho.jsp.JavaPage.service(JavaPage.java:61)<br />
[11:04:33.250] &nbsp;at com.caucho.jsp.Page.pageservice(Page.java:586)<br />
[11:04:33.250] &nbsp;at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:190)<br />
[11:04:33.250] &nbsp;at yixun.wap.filter.ReplaceTextFilter.doFilter(ReplaceTextFilter.java:77)<br />
[11:04:33.250] &nbsp;at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)<br />
[11:04:33.250] &nbsp;at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:167)<br />
[11:04:33.250] &nbsp;at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:226)<br />
[11:04:33.250] &nbsp;at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:263)<br />
[11:04:33.250] &nbsp;at com.caucho.server.port.TcpConnection.run(TcpConnection.java:477)<br />
[11:04:33.250] &nbsp;at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:591)<br />
[11:04:33.250] &nbsp;at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:513)<br />
[11:04:33.250] &nbsp;at java.lang.Thread.run(Thread.java:619) <br />
<br />
关于这个问题，以前是能经常碰到的，也没仔细的去研究，这段时间又碰到了，阴魂不散的。今天刚好有时间查查，<br />
网上都说是有out.println()，也就是说在转发的同时，容器回去检查该连接是否与客户端正在传输数据。<br />
<br />
所以知道原理了，操作起来就好办了，直接response.getWriter().close();<br />
就是说关闭response的输出，再进行转发
<img src ="http://www.blogjava.net/jzone/aggbug/286808.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jzone/" target="_blank">Gavin.lee</a> 2009-07-15 11:11 <a href="http://www.blogjava.net/jzone/articles/286808.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>wap request head （comms）</title><link>http://www.blogjava.net/jzone/articles/280641.html</link><dc:creator>Gavin.lee</dc:creator><author>Gavin.lee</author><pubDate>Mon, 08 Jun 2009 05:40:00 GMT</pubDate><guid>http://www.blogjava.net/jzone/articles/280641.html</guid><wfw:comment>http://www.blogjava.net/jzone/comments/280641.html</wfw:comment><comments>http://www.blogjava.net/jzone/articles/280641.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jzone/comments/commentRss/280641.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jzone/services/trackbacks/280641.html</trackback:ping><description><![CDATA[wap request Head，其实对于不同品牌的手机，发送的头部都会有区别的：<br />
【联通】HTTP_ACCEPT:application/vnd.wap.wmlc;Type=1108, application/vnd.wap.wmlc, application/vnd.wap.wmlscriptc, application/vnd.uplanet.signal, application/vnd.uplanet.cacheop-wbxml, application/vnd.uplanet.alert-wbxml, application/vnd.uplanet.channel-wbxml, application/vnd.uplanet.list-wbxml, application/vnd.uplanet.listcmd-wbxml, application/vnd.uplanet.bearer-choice-wbxml, application/vnd.wap.multipart.related, application/vnd.wap.multipart.mixed, application/x-up-device, application/vnd.phonecom.mmc-wbxml, application/octet-stream, image/vnd.wap.wbmp, image/png, image/bmp,image/vnd.wap.wbmp,application/vnd.uplanet.alert,application/x-up-alert,application/vnd.uplanet.bearer-choice,application/vnd.uplanet.cacheop,application/x-up-cacheop,application/vnd.uplanet.channel,application/vnd.uplanet.list,application/vnd.uplanet.listcmd,application/vnd.phonecom.mmc-xml,text/x-wap.wml,text/vnd.wap.wml,text/x-hdml,text/vnd.wap.wmlscript, */*<br />
HTTP_ACCEPT_LANGUAGE:zh, en<br />
HTTP_CONNECTION:close<br />
HTTP_HOST:myhyli.digichina.net<br />
HTTP_USER_AGENT:LGE-LG8380/1.0 UP.Browser/4.1.26l UP.Link/5.1.2.9<br />
HTTP_COOKIE:ASPSESSIONIDQATSASTC=OEHIAIKADHNCNMNHAEIAEPLC;CUI=468;TESTUSER=N<br />
HTTP_VIA:1.1 sh-bgw04:3128 (Squid/2.3.STABLE3), 1.0 sh-bgw04:81, 1.0 sdblbg01:81<br />
HTTP_ACCEPT_CHARSET:utf-8, UTF-8, *<br />
HTTP_CACHE_CONTROL:max-age=259200<br />
HTTP_MAX_FORWARDS:2<br />
HTTP_X_FORWARDED_FOR:10.83.56.88, 10.95.17.106, 127.0.0.1, 211.95.66.93<br />
HTTP_X_UP_DEVCAP_CHARSET:utf-8<br />
HTTP_X_UP_DEVCAP_IMMED_ALERT:1<br />
HTTP_X_UP_DEVCAP_ISCOLOR:1<br />
HTTP_X_UP_DEVCAP_MAX_PDU:8192<br />
HTTP_X_UP_DEVCAP_MSIZE:7,14<br />
HTTP_X_UP_DEVCAP_NUMSOFTKEYS:2<br />
HTTP_X_UP_DEVCAP_SCREENCHARS:24,13<br />
HTTP_X_UP_DEVCAP_SCREENDEPTH:18<br />
HTTP_X_UP_DEVCAP_SCREENPIXELS:169,183<br />
HTTP_X_UP_DEVCAP_SOFTKEYSIZE:12<br />
HTTP_X_UP_FAX_ACCEPTS:text/plain, application/postscript, application/msword, application/rtf, application/pdf<br />
HTTP_X_UP_FAX_ENCODINGS:7bit, 8bit, base64, quoted-printable<br />
HTTP_X_UP_FAX_LIMIT:100000<br />
HTTP_X_UP_SUBNO:联通手机号码<br />
HTTP_X_UP_UPLINK:gateway<br />
HTTP_X_UP_WAPPUSH_SECURE:gatewaysh.hq.wap.uni-info.com.cn:9003/pap<br />
HTTP_X_UP_WAPPUSH_UNSECURE:gatewaysh.hq.wap.uni-info.com.cn:9002/pap<br />
HTTP_X_UP_WTLS_INFO:off<br />
<br />
【移动】[HTTP_ACCEPT] =&gt; application/x-zip, application/vnd.ces-quickword, application/vnd.ces-quicksheet, audio/wav, audio/x-wav, audio/basic, audio/x-au, audio/au, audio/x-basic, video/mp4, video/mpeg4, video/3gpp, application/vnd.rn-realmedia, audio/amr-wb, audio/amr, audio/mp3, application/sdp, audio/sp-midi, audio/x-beatnik-rmf, audio/midi, audio/aac, audio/mpeg, audio/3gpp, audio/mp4, application/java-archive, text/vnd.sun.j2me.app-descriptor, text/html, application/vnd.wap.xhtml+xml, application/xhtml+xml, application/vnd.wap.wmlc, text/vnd.wap.wml, application/vnd.wap.wbxml1, application/vnd.wap.wmlscriptc, multipart/mixed, application/x-nokiagamedata, application/vnd.ces-quickpoint, video/avi, application/smil, application/pdf, application/vnd.symbian.install, audio/x-pn-realaudio-plugin, audio/x-pn-realaudio, audio/mpegurl, audio/x-mpegurl, text/x-co-desc, application/vnd.oma.dd+xml, application/x-wallet-appl.user-data-provision, application/vnd.met.ticket, application/vnd.nokia.ringing-tone, text/vnd.symbian.wml.dtd, application/vnd.wap.wbxml, application/java, video/3gp, audio/rmf, audio/x-rmf, audio/x-midi, application/x-java-archive, application/vnd.oma.drm.message, psint/eloader, application/x-x509-ca-cert, text/plain, text/x-vcard, text/calendar, text/x-vcalendar, video/qmv, text/css, image/*, text/x-vcard, image/gif, image/vnd.wap.wbmp, text/vnd.wap.wmlscript<br />
&nbsp; &nbsp; [HTTP_ACCEPT_LANGUAGE] =&gt; zh-ch, zh<br />
&nbsp; &nbsp; [HTTP_CONNECTION] =&gt; close<br />
&nbsp; &nbsp; [HTTP_HOST] =&gt; 0791.jxs.cn<br />
&nbsp; &nbsp; [HTTP_USER_AGENT] =&gt; Nokia6670/2.0 (6.0525.0ch) SymbianOS/7.0s Series60/2.1 Profile/MIDP-2.0 Configuration/CLDC-1.0<br />
&nbsp; &nbsp; [HTTP_CONTENT_LENGTH] =&gt; 0<br />
&nbsp; &nbsp; [HTTP_VIA] =&gt; WTP/1.1 GDGZ-PS-GW006-WAP03.gd.chinamobile.com (Nokia WAP Gateway 4.0/CD3/4.1.29)<br />
&nbsp; &nbsp; [HTTP_ACCEPT_ENCODING] =&gt; gzip;q=1.0, identity; q=0.8<br />
&nbsp; &nbsp; [HTTP_ACCEPT_CHARSET] =&gt; gb2312, iso-8859-1, utf-8, iso-10646-ucs-2; q=0.6<br />
&nbsp; &nbsp; [HTTP_X_WAP_PROFILE] =&gt; "http://nds1.nds.nokia.com/uaprof/N6670r100.xml"<br />
&nbsp; &nbsp; [HTTP_X_NETWORK_INFO] =&gt; GPRS,8613631402**,10.100.246.217,cmwap,unsecured<br />
&nbsp; &nbsp; [HTTP_X_FORWARDED_FOR] =&gt; 10.100.246.217<br />
&nbsp; &nbsp; [HTTP_X_UP_CALLING_LINE_ID] =&gt;&nbsp;移动手机号码<br />
&nbsp;&nbsp;&nbsp; [HTTP_X_SOURCE_ID] =&gt; cmwap<br />
&nbsp; &nbsp; [HTTP_X_NOKIA_CONNECTION_MODE] =&gt; TCP<br />
&nbsp; &nbsp; [HTTP_X_UP_BEARER_TYPE] =&gt; GPRS<br />
&nbsp; &nbsp; [HTTP_X_NOKIA_GATEWAY_ID] =&gt; NWG/4.0/CD3/Build04 <br />
<br />
<br />
<br />
<p>accept:text/x-vCard,application/smil,image/gif,text/plain,audio/x-midi,text/html,image/bmp,image/vnd.wap.wbmp,text/x-vCalendar,application/vnd.wap.wmlscriptc,application/vnd.phonecom.mmc-wbxml,audio/midi,audio/smaf,image/png,application/vnd.oma.drm.message,application/vnd.wap.mms-message,image/jpg,image/x-up-wpng,application/vnd.wap.multipart.related,application/octet-stream,application/vnd.wap.multipart.mixed,application/vnd.wap.coc,text/x-imelody,text/css,application/x-smaf,application/vnd.wap.sic,application/vnd.uplanet.bearer-choice-wbxml,application/vnd.wap.slc,audio/x-mid,application/xhtml+xml; profile="http://www.wapforum.org/xhtml",application/vnd.wap.connectivity-wbxml,application/vnd.wap.xhtml+xml,application/vnd.smaf,audio/amr,image/jpeg,audio/smf,audio/mid,audio/imelody,application/vnd.wap.wmlc,application/x-imelody, text/vnd.wap.wml, text/vnd.wap.wmlscript, text/vnd.wap.co, text/vnd.wap.si, text/vnd.wap.sl, text/vnd.wap.connectivity-xml <br />
user-agent:NEC-N700/1.0 UP.Browser/6.2.2.4.d.1.102 (GUI) MMP/1.0 <br />
accept-charset:utf-8 <br />
accept-language:zh-cn <br />
profile:http://nec-uap.com/prof/N700V01.xml <br />
x-up-devcap-screenpixels:120,140 <br />
x-up-devcap-msize:11,6 <br />
x-up-devcap-softkeysize:12 <br />
x-up-devcap-immed-alert:1 <br />
x-up-devcap-iscolor:1 <br />
x-up-devcap-screendepth:8 <br />
cookie:JSESSIONID=6B72F4F8469C0113D1544ACC1BA2A9FE <br />
via:WTP/1.1 WAPGW-6.wh.monternet.com (Nokia WAP Gateway 3.1/ECD9/3.1.53), HTTP/1.1 HTTPPRXY-4[0A0000D4] (Traffic-Server/4.0.9 [uSc ]) <br />
x-network-info:GPRS,10.139.155.216,13951615696,211.139.172.70,unsecured <br />
x-forwarded-for:10.139.155.216 <br />
<span class="hilite1"><font style="background-color: #ffff00">x-up-calling-line-id</font></span>:13961665696 <br />
x-source-id:211.139.172.70 <br />
x-nokia-connection_mode:CMODE <br />
x-nokia-bearer:GPRS <br />
x-nokia-gateway-id:NAWG/3.1/Build53 <br />
client-ip:10.0.0.144 <br />
<br />
<br />
<br />
accept：终端可以接受的媒体类型； <br />
user-agent：终端的型号和其它一些信息；<span style="color: red">//这个现在已经取不到了</span> <br />
accept-charset：终端可以接受的编码集； <br />
accept-language：可以接受的语言； <br />
cookie：终端发上来的cookie啦，一些状态信息； <br />
via：访问路径上通过了一个代理设备，这里就是WAPGW-6.wh.monternet.com 这个WAP网关啦，武汉的吧，呵呵； <br />
client-ip：终端的IP啦； <br />
<br />
x-up-devcap-screenpixels:120,140 <br />
x-up-devcap-msize:11,6 <br />
x-up-devcap-softkeysize:12 <br />
x-up-devcap-immed-alert:1 <br />
x-up-devcap-iscolor:1 <br />
x-up-devcap-screendepth:8 <br />
上面这几行都是终端设备的参数； <br />
<br />
<br />
<br />
x-forwarded-for:10.139.155.216 <br />
wap网关的地址，需要走武汉的网关再到server； <br />
<br />
<span class="hilite1"><font style="background-color: #ffff00">x-up-calling-line-id</font></span>:13961665696<span style="color: red">//这个现在已经取不到了</span> <br />
主叫线标识，就是主叫号码； <br />
<br />
x-source-id:211.139.172.70 <br />
x-nokia-connection_mode:CMODE <br />
连接模式，wap2.0的两种访问模式之一； <br />
<br />
x-nokia-bearer:GPRS <br />
承载方式，为GPRS <br />
<br />
x-nokia-gateway-id:NAWG/3.1/Build53 <br />
Nokia的wap网关的版本了</p>
<img src ="http://www.blogjava.net/jzone/aggbug/280641.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jzone/" target="_blank">Gavin.lee</a> 2009-06-08 13:40 <a href="http://www.blogjava.net/jzone/articles/280641.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>wap 测试工具（opera firefox M3gate）</title><link>http://www.blogjava.net/jzone/articles/271825.html</link><dc:creator>Gavin.lee</dc:creator><author>Gavin.lee</author><pubDate>Wed, 20 May 2009 15:45:00 GMT</pubDate><guid>http://www.blogjava.net/jzone/articles/271825.html</guid><wfw:comment>http://www.blogjava.net/jzone/comments/271825.html</wfw:comment><comments>http://www.blogjava.net/jzone/articles/271825.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jzone/comments/commentRss/271825.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jzone/services/trackbacks/271825.html</trackback:ping><description><![CDATA[做wap有段时间了，从web到wap，开始时候最不习惯的就是wap的界面了，太单调了。呵呵，不过wap简单嘛。言归正传，在正常的测试时候，用到得最多的还是opera，说到opera支持wap，知道的人应该不会有任何疑问了，随便找个opera&nbsp; down下来，装上就可以了；其次就是算firefox了，当时做web的时候，测试用的最多的还是FF &amp;&amp;　IE&nbsp; ，现在IE基本上对我来说就死退休了。除非我要google时候，或者查看报文（xml）时候。FF也少用了。<br />
<br />
FF下安装一个扩展插件就可以使FF也能支持wap了：<br />
网上找到 wmlbrowser（我用的是wmlbrowser-0.7.20.xpi）感觉还不错；直接给拖到FF里面，点安装，重启FF。输入wap地址。就OK了， O(&#8745;_&#8745;)O~，简单吧。<br />
<br />
然后少用的就是M3gate，这个工具对WML要求非常的严格。很多时候我们不需要考虑太多了。一般的手机都能处理很多了，比如说这家伙就不认识相对路径，很麻烦的。绝大部分的手机都是可以的。（刚接触wap的时候，我们老大说了，要经过opera测试，再过M3gate测试，然后本地测试，线下测试，再线上测试，最后都OK了才能发布）现在想想其实没那么严格了。多注意点，就少挨点客户的骂了。 <br />
<br />
貌似上面说的插件少了一个？？ 有问题回头再贴了，先到这里了。 记住时间 2009-5-20 23:45:13。有点累了，睡觉。<br />
<br />
<span style="font-size: 14pt"><strong>续：<strong>User Agent Switcher 插件</strong></strong></span> <br />
确实有的时候程序对来访者的user-agent进行了判断，所以还需要这个插件。<br />
<br />
安装完毕后，这时候FF就会优先访问wap了。其实里面还有很多玄机。用了才知道了。 O(&#8745;_&#8745;)O~
  <img src ="http://www.blogjava.net/jzone/aggbug/271825.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jzone/" target="_blank">Gavin.lee</a> 2009-05-20 23:45 <a href="http://www.blogjava.net/jzone/articles/271825.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>