??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美日韩三级,最新国产精品久久,天堂av中文在线资源库http://www.aygfsteel.com/dragonjack/Java知识Q自q随想Q开发过E中的一些经验等?/description>zh-cnThu, 19 Jun 2025 04:55:45 GMTThu, 19 Jun 2025 04:55:45 GMT60关于JSP中下?/title><link>http://www.aygfsteel.com/dragonjack/archive/2005/11/26/21499.html</link><dc:creator>寻觅</dc:creator><author>寻觅</author><pubDate>Sat, 26 Nov 2005 04:43:00 GMT</pubDate><guid>http://www.aygfsteel.com/dragonjack/archive/2005/11/26/21499.html</guid><wfw:comment>http://www.aygfsteel.com/dragonjack/comments/21499.html</wfw:comment><comments>http://www.aygfsteel.com/dragonjack/archive/2005/11/26/21499.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/dragonjack/comments/commentRss/21499.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/dragonjack/services/trackbacks/21499.html</trackback:ping><description><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">最q的工作中涉及到了下载机能,在做的过E中遇到了下面一些问题。这些问题都已经解决了,但是对策肯定不是唯一Q如果大家有好的对策Q愿意共通研I。或者在下蝲q程中有什么其他需要注意的问题Q敬L(fng)a?/SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">1?SPAN style="FONT: 7pt 'Times New Roman'">  </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">下蝲完毕后不能够重定向画面。这U情冉|发生在用了</SPAN><SPAN lang=EN-US>frameset</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的画面上?BR></SPAN><SPAN lang=EN-US><BR></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><STRONG>基本现象Q?/STRONG></SPAN><SPAN lang=EN-US><BR></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">点击下蝲按钮Q下载执行完毕后Q再按其他的按钮Q会出现</SPAN><SPAN lang=EN-US>javascript</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">错误Q不能够扑ֈ原来画面中的控g。原因就是因Z载完毕后不能够重定向到原来的画面?/SPAN><SPAN lang=EN-US><BR><BR></SPAN><STRONG><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">原因及对{?/SPAN><SPAN lang=EN-US>1</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q?/SPAN></STRONG><SPAN lang=EN-US><BR></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提交的时候把提交?/SPAN><SPAN lang=EN-US>form</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/SPAN><SPAN lang=EN-US>target</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">讑֮?/SPAN><SPAN lang=EN-US>top</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q这样下载完毕后Q页面能够重定向Q就不会出现</SPAN><SPAN lang=EN-US>javascript</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">代码语法错误的现象。同时用这U方法能够把下蝲q程中出现的错误信息昄在原来的画面上。此旉要注意一点,׃提交到的?/SPAN><SPAN lang=EN-US>top</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q所以出错返回的画面也要是整?/SPAN><SPAN lang=EN-US>frame</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的画面,同时q要保存原画面用戯入的数据Q所以徏议原来画面的数据使用</SPAN><SPAN lang=EN-US>session</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">来保存?/SPAN><SPAN lang=EN-US><BR>function clickButton(){<BR><SPAN style="mso-spacerun: yes">    </SPAN>form.target = “_top?BR><SPAN style="mso-spacerun: yes">    </SPAN>form.submit();<BR>}<BR><BR></SPAN><STRONG><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">原因及对{?/SPAN><SPAN lang=EN-US>2</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q?/SPAN></STRONG><SPAN lang=EN-US><BR></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在当前页面添加一个内用于下载用,提交下蝲?/SPAN><SPAN lang=EN-US>form</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的时候可以把</SPAN><SPAN lang=EN-US>target</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">指定到内上Q这样不会媄响到原来画面Q原画面可以l箋操作。不q这U方法存在着弊端Q一是很难?/SPAN><SPAN lang=EN-US>javascript</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">防止多重提交。二、如果下载过E中出现错误Q显C错误信息比较麻烦。鉴于上qCU弊端用这U方法一般是提交两次Q第一ơ正常提交把要下载的数据准备好,保证下蝲能够正常q行Q对于出错的处理也是在这一ơ进行的Q第二次提交是提交到内祯Q此ơ提交只是进行下载直接,不考虑会出现错误。这ơ提交是?/SPAN><SPAN lang=EN-US>onload</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中执行的?/SPAN><SPAN lang=EN-US><BR><SPAN style="mso-spacerun: yes">  </SPAN><iframe name="download" style=?B> </B><SPAN style="mso-bidi-font-weight: bold">visibility:hidden</SPAN>?><BR></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提交的时候用下面的</SPAN><SPAN lang=EN-US>javascript<BR>function clickButton(){<BR><SPAN style="mso-spacerun: yes">    </SPAN>form.target = “download?<BR><SPAN style="mso-spacerun: yes">    </SPAN>form.submit();<BR>}</SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt"><STRONG><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">2?SPAN style="FONT: 7pt 'Times New Roman'">  </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">不正常的下蝲现象?/SPAN></STRONG><SPAN lang=EN-US><BR></SPAN><STRONG><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">现象</SPAN><SPAN lang=EN-US>1</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q?/SPAN></STRONG><SPAN lang=EN-US><BR></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/SPAN><SPAN lang=EN-US>windows2000</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">操作pȝ下,有时候点M载,弹出下蝲对话框后点击打开Q会再次弹出打开对话框?/SPAN><SPAN lang=EN-US><BR><BR></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><STRONG>原因及对{:</STRONG></SPAN><SPAN lang=EN-US><BR></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">q可能是</SPAN><SPAN lang=EN-US>IE</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的安全设定生的问题Q如果要解决q个问题Q也有办法。我在反复的试验中发玎ͼ出现q种现象的时候,提交下蝲?/SPAN><SPAN lang=EN-US>form</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中的数据?/SPAN><SPAN lang=EN-US>server</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">端被用到Q此时就会出现弹Zơ对话框的现象,如果没有</SPAN><SPAN lang=EN-US>form</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中没有数据或?/SPAN><SPAN lang=EN-US>form</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中的数据?/SPAN><SPAN lang=EN-US>server</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">端不会被使用Q那么就不会有这U现象,所?/SPAN><SPAN lang=EN-US>download</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/SPAN><SPAN lang=EN-US>form</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以讑֮一个空?/SPAN><SPAN lang=EN-US>form</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。(如果考虑?/SPAN><SPAN lang=EN-US>netscape</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">览器,</SPAN><SPAN lang=EN-US>form</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">里面q要放上一?/SPAN><SPAN lang=EN-US>hidden</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">控gQ否?/SPAN><SPAN lang=EN-US>netscape</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/SPAN><SPAN lang=EN-US>form</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提交不了。)q样q种现象׃会出C?/SPAN><SPAN lang=EN-US><BR><form name=”mainForm?gt;<BR><SPAN style="mso-spacerun: yes">   </SPAN><input type=”button?name=”download?onclick=”clickButton()?gt;<BR></form><BR><form name=”downLoadForm?gt;<BR><SPAN style="mso-spacerun: yes">   </SPAN><input type=”hidden?name=”noUsed?/><BR></form><BR></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使用?/SPAN><SPAN lang=EN-US>javascript</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">如下Q?/SPAN><SPAN lang=EN-US><BR>function clickButton(){<BR><SPAN style="mso-spacerun: yes">   </SPAN>downLoadForm.submit();<BR>}<BR><BR></SPAN><STRONG><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">现象</SPAN><SPAN lang=EN-US>2</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Q?/SPAN></STRONG><SPAN lang=EN-US><BR></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">?/SPAN><SPAN lang=EN-US>windowsXP</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">下,有时候下载会D弹出安全制M的提C条?/SPAN><SPAN lang=EN-US><BR><BR></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><STRONG>原因及对{:</STRONG></SPAN><SPAN lang=EN-US><BR></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我所遇到的这L(fng)问题产生的原因是Q我是用?/SPAN><SPAN lang=EN-US>1</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中的对策</SPAN><SPAN lang=EN-US>2,</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在准备完毕数据后Q在</SPAN><SPAN lang=EN-US>onload</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">Ҏ(gu)中执行了提交到内的下蝲操作Q结果出C安全的提C条Q页面最上端Q。对{方法就是不?/SPAN><SPAN lang=EN-US>onload</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提交下蝲的操作?/SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p> </o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt"><STRONG><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">3?SPAN style="FONT: 7pt 'Times New Roman'">  </SPAN></SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">有关下蝲的性能问题?/SPAN></STRONG></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 17.95pt; TEXT-INDENT: 21pt; mso-para-margin-left: 1.71gd; mso-char-indent-count: 2.0"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">如果下蝲的是固定的文件一般不会有问题Q我们可以通过</SPAN><SPAN lang=EN-US>File</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">cȝҎ(gu)得到文g的长度,然后分次写入到流可以了。但是有时候下载的内容可能动态组成的Q比如说从数据库索出来的{。在q种情况下,如果先从数据库中索出所有的数据Q然后在把数据按照下载的格式~辑出来Q最后再出长度分次写入到流中,性能肯定不高。ؓ(f)了提交性能Q我们可以这样做Q一ơ编辑一定数目的记录Q然后就向流中写入,q样也是分次的写入到中。在q种方式下,用户能够快看到下蝲的对话框Q减等待时_同时也减了下蝲q程中内存的使用量,提高了下载的性能?/SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p> </o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">上面三个问题是我在?/SPAN><SPAN lang=EN-US>struts</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">框架做下载功能时遇到的一些问题,以及自己的一些对{,供大家参考如果大家有更好的解军_法,误教?/SPAN></P><img src ="http://www.aygfsteel.com/dragonjack/aggbug/21499.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/dragonjack/" target="_blank">寻觅</a> 2005-11-26 12:43 <a href="http://www.aygfsteel.com/dragonjack/archive/2005/11/26/21499.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>发芽http://www.aygfsteel.com/dragonjack/archive/2005/11/10/19232.html寻觅寻觅Thu, 10 Nov 2005 15:57:00 GMThttp://www.aygfsteel.com/dragonjack/archive/2005/11/10/19232.htmlhttp://www.aygfsteel.com/dragonjack/comments/19232.htmlhttp://www.aygfsteel.com/dragonjack/archive/2005/11/10/19232.html#Feedback1http://www.aygfsteel.com/dragonjack/comments/commentRss/19232.htmlhttp://www.aygfsteel.com/dragonjack/services/trackbacks/19232.html         我是一名程序员Q主要是作Java斚w开发的Q喜Ƣ学?fn)Java斚w的技术,Z能够使自p够更好的掌握Java斚w的知识,我想通过博客把自己学?fn)的一些想法记录下来,和各位交一下,共同提高嘛!先谢谢诸位朋友了Q以后还希望能够l常光顾我的博客Q给出徏议?img src ="http://www.aygfsteel.com/dragonjack/aggbug/19232.html" width = "1" height = "1" />

寻觅 2005-11-10 23:57 发表评论
]]>
վ֩ģ壺 | | | ɽ| | »| ͤ| Ϸ| | ɽ| | ţ| ̫| ϴ| ȫ| ׯ| ɽ| | | | | | | | | | | | ߺ| | ¡Ң| ʦ| | Ϫ| ƽ| | | | | | |