??xml version="1.0" encoding="utf-8" standalone="yes"?>国产日韩精品视频一区二区三区,中文字幕一区av,精品一区二区日韩http://www.aygfsteel.com/alex/archive/2007/09/01/141902.htmlAlexAlexSat, 01 Sep 2007 04:42:00 GMThttp://www.aygfsteel.com/alex/archive/2007/09/01/141902.htmlhttp://www.aygfsteel.com/alex/comments/141902.htmlhttp://www.aygfsteel.com/alex/archive/2007/09/01/141902.html#Feedback0http://www.aygfsteel.com/alex/comments/commentRss/141902.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/141902.html阅读全文

Alex 2007-09-01 12:42 发表评论
]]>
WEB开发流E?步骤)http://www.aygfsteel.com/alex/archive/2007/06/13/123899.htmlAlexAlexWed, 13 Jun 2007 08:43:00 GMThttp://www.aygfsteel.com/alex/archive/2007/06/13/123899.htmlhttp://www.aygfsteel.com/alex/comments/123899.htmlhttp://www.aygfsteel.com/alex/archive/2007/06/13/123899.html#Feedback4http://www.aygfsteel.com/alex/comments/commentRss/123899.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/123899.html阅读全文

Alex 2007-06-13 16:43 发表评论
]]>
[zt]Response.ContentType 详细列表http://www.aygfsteel.com/alex/archive/2007/03/29/107125.htmlAlexAlexThu, 29 Mar 2007 01:25:00 GMThttp://www.aygfsteel.com/alex/archive/2007/03/29/107125.htmlhttp://www.aygfsteel.com/alex/comments/107125.htmlhttp://www.aygfsteel.com/alex/archive/2007/03/29/107125.html#Feedback0http://www.aygfsteel.com/alex/comments/commentRss/107125.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/107125.html
come from here


 

在经典同时看C个关于ContentType的问?/p>

http://bbs.blueidea.com/thread-2729935-1-1.html

http://bbs.blueidea.com/thread-2729945-1-1.html

所以查了下资料,copy了一份详l的ContentType的列?/p>

 

不同的ContentType 会媄响客L所看到的效?

默认的ContentType?text/html  也就是网|?

代码?

<% response.ContentType ="text/html" %> 
<!--Qi nclude virtual="/ContentType.html" -->

昄的ؓ|页,?/p>

<% response.ContentType ="text/plain" %> 
<!--Qi nclude virtual="/sscript/

则会昄html原代?

以下Z些常用的 ContentType

GIF images
<% response.ContentType ="image/gif" %> 
<!--Qi nclude virtual="/myimage.gif" -->
JPEG images
<% response.ContentType ="image/jpeg" %> 
<!--Qi nclude virtual="/myimage.jpeg" -->
TIFF images
<% response.ContentType ="image/tiff" %> 
<!--Qi nclude virtual="/myimage.tiff" -->
MICROSOFT WORD document
<% response.ContentType ="application/msword" %> 
<!--Qi nclude virtual="/myfile.doc" -->
RTF document
<% response.ContentType ="application/rtf" %> 
<!--Qi nclude virtual="/myfile.rtf" -->
MICROSOFT EXCEL document
<% response.ContentType ="application/x-excel" %> 
<!--Qi nclude virtual="/myfile.xls" -->
MICROSOFT POWERPOINT document
<% response.ContentType ="application/ms-powerpoint" %> 
<!--Qi nclude virtual="/myfile.pff" -->
PDF document
<% response.ContentType ="application/pdf" %> 
<!--Qi nclude virtual="/myfile.pdf" -->
ZIP document
<% response.ContentType ="application/zip" %> 
<!--Qi nclude virtual="/myfile.zip" -->

 

下面是更详细的ContentType

application/andrew-insetez
application/mac-binhex40hqx
application/mac-compactprocpt
application/mathml+xmlmathml
application/msworddoc
application/octet-streambin dms lha lzh exe class so dll
application/odaoda
application/oggogg
application/pdfpdf
application/postscriptai eps ps
application/rdf+xmlrdf
application/smilsmi smil
application/srgsgram
application/srgs+xmlgrxml
application/vnd.mifmif
application/vnd.mozilla.xul+xmlxul
application/vnd.ms-excelxls
application/vnd.ms-powerpointppt
application/vnd.wap.wbxmlwbxml
application/vnd.wap.wmlc.wmlc wmlc
application/vnd.wap.wmlscriptc.wmlsc wmlsc
application/voicexml+xmlvxml
application/x-bcpiobcpio
application/x-cdlinkvcd
application/x-chess-pgnpgn
application/x-cpiocpio
application/x-cshcsh
application/x-directordcr dir dxr
application/x-dvidvi
application/x-futuresplashspl
application/x-gtargtar
application/x-hdfhdf
application/x-httpd-php.php .php4 .php3 .phtml
application/x-httpd-php-source.phps
application/x-javascriptjs
application/x-koanskp skd skt skm
application/x-latexlatex
application/x-netcdfnc cdf
application/x-pkcs7-crl.crl
application/x-shsh
application/x-sharshar
application/x-shockwave-flashswf
application/x-stuffitsit
application/x-sv4cpiosv4cpio
application/x-sv4crcsv4crc
application/x-tar.tgz tar
application/x-tcltcl
application/x-textex
application/x-texinfotexinfo texi
application/x-trofft tr roff
application/x-troff-manman
application/x-troff-meme
application/x-troff-msms
application/x-ustarustar
application/x-wais-sourcesrc
application/x-x509-ca-cert.crt
application/xhtml+xmlxhtml xht
application/xmlxml xsl
application/xml-dtddtd
application/xslt+xmlxslt
application/zipzip
audio/basicau snd
audio/midimid midi kar
audio/mpegmpga mp2 mp3
audio/x-aiffaif aiff aifc
audio/x-mpegurlm3u
audio/x-pn-realaudioram rm
audio/x-pn-realaudio-pluginrpm
audio/x-realaudiora
audio/x-wavwav
chemical/x-pdbpdb
chemical/x-xyzxyz
image/bmpbmp
image/cgmcgm
image/gifgif
image/iefief
image/jpegjpeg jpg jpe
image/pngpng
image/svg+xmlsvg
image/tifftiff tif
image/vnd.djvudjvu djv
image/vnd.wap.wbmp.wbmp wbmp
image/x-cmu-rasterras
image/x-iconico
image/x-portable-anymappnm
image/x-portable-bitmappbm
image/x-portable-graymappgm
image/x-portable-pixmapppm
image/x-rgbrgb
image/x-xbitmapxbm
image/x-xpixmapxpm
image/x-xwindowdumpxwd
model/igesigs iges
model/meshmsh mesh silo
model/vrmlwrl vrml
text/calendarics ifb
text/csscss
text/html.shtml html htm
text/plainasc txt
text/richtextrtx
text/rtfrtf
text/sgmlsgml sgm
text/tab-separated-valuestsv
text/vnd.wap.wml.wml wml
text/vnd.wap.wmlscript.wmls wmls
text/x-setextetx
video/mpegmpeg mpg mpe
video/quicktimeqt mov
video/vnd.mpegurlmxu
video/x-msvideoavi
video/x-sgi-moviemovie
x-conference/x-cooltalkice


Alex 2007-03-29 09:25 发表评论
]]>
[zt]用JSP实现上传文g的两U方?/title><link>http://www.aygfsteel.com/alex/archive/2007/03/26/106538.html</link><dc:creator>Alex</dc:creator><author>Alex</author><pubDate>Mon, 26 Mar 2007 14:18:00 GMT</pubDate><guid>http://www.aygfsteel.com/alex/archive/2007/03/26/106538.html</guid><wfw:comment>http://www.aygfsteel.com/alex/comments/106538.html</wfw:comment><comments>http://www.aygfsteel.com/alex/archive/2007/03/26/106538.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.aygfsteel.com/alex/comments/commentRss/106538.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/alex/services/trackbacks/106538.html</trackback:ping><description><![CDATA[     摘要:   <a href='http://www.aygfsteel.com/alex/archive/2007/03/26/106538.html'>阅读全文</a><img src ="http://www.aygfsteel.com/alex/aggbug/106538.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/alex/" target="_blank">Alex</a> 2007-03-26 22:18 <a href="http://www.aygfsteel.com/alex/archive/2007/03/26/106538.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>jsp防盗?/title><link>http://www.aygfsteel.com/alex/archive/2007/03/13/103458.html</link><dc:creator>Alex</dc:creator><author>Alex</author><pubDate>Tue, 13 Mar 2007 02:01:00 GMT</pubDate><guid>http://www.aygfsteel.com/alex/archive/2007/03/13/103458.html</guid><wfw:comment>http://www.aygfsteel.com/alex/comments/103458.html</wfw:comment><comments>http://www.aygfsteel.com/alex/archive/2007/03/13/103458.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.aygfsteel.com/alex/comments/commentRss/103458.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/alex/services/trackbacks/103458.html</trackback:ping><description><![CDATA[key words : jsp防盗?header<br /><br />最q碰到盗铄问题Q即复制一个url地址Q在另一个地方也能访问?br /><br />index.jsp面<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 src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">html</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />  </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">head</span><span style="COLOR: #0000ff">><</span><span style="COLOR: #800000">title</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">Simple jsp page</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">title</span><span style="COLOR: #0000ff">></</span><span style="COLOR: #800000">head</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />  </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">body</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">Place your content here<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />  here is index jsp<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />    get header info<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />  </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">a </span><span style="COLOR: #ff0000">href</span><span style="COLOR: #0000ff">="a.jsp"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">a.jsp</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">a</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />  </span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">body</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">html</span><span style="COLOR: #0000ff">></span></div><br />a.jsp面<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 src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">html</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />  </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">head</span><span style="COLOR: #0000ff">><</span><span style="COLOR: #800000">title</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">Simple jsp page</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">title</span><span style="COLOR: #0000ff">></</span><span style="COLOR: #800000">head</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />  </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">body</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">Place your content here<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />  here is a. jsp<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />    get header info<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />  </span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00"><%</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">request.getHeader(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">Referer</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">)</span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%></span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_163_265_Open_Image" onclick="this.style.display='none'; Codehighlighter1_163_265_Open_Text.style.display='none'; Codehighlighter1_163_265_Closed_Image.style.display='inline'; Codehighlighter1_163_265_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_163_265_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_163_265_Closed_Text.style.display='none'; Codehighlighter1_163_265_Open_Image.style.display='inline'; Codehighlighter1_163_265_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />  </span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00"><%</span><span id="Codehighlighter1_163_265_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.aygfsteel.com/images/dot.gif" /></span><span id="Codehighlighter1_163_265_Open_Text"><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">if</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">null</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">==</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> request.getHeader(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">Referer</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">) || request.getHeader(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">Referer</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">).indexOf(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">yourdomain.com</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">) </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">0</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">){</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />     做h要厚?br /><img id="Codehighlighter1_283_288_Open_Image" onclick="this.style.display='none'; Codehighlighter1_283_288_Open_Text.style.display='none'; Codehighlighter1_283_288_Closed_Image.style.display='inline'; Codehighlighter1_283_288_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_283_288_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_283_288_Closed_Text.style.display='none'; Codehighlighter1_283_288_Open_Image.style.display='inline'; Codehighlighter1_283_288_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />  </span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00"><%</span><span id="Codehighlighter1_283_288_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.aygfsteel.com/images/dot.gif" /></span><span id="Codehighlighter1_283_288_Open_Text"><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">}</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">else</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{</span></span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />  合法讉K<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />  </span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00"><%</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">}</span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />  </span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">body</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">html</span><span style="COLOR: #0000ff">></span></div><br /><br />即从内部讉K可以Q直接粘贴地址在另一个浏览器里访问禁?img src ="http://www.aygfsteel.com/alex/aggbug/103458.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/alex/" target="_blank">Alex</a> 2007-03-13 10:01 <a href="http://www.aygfsteel.com/alex/archive/2007/03/13/103458.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[讨论]上传文g攑֜哪里比较合?http://www.aygfsteel.com/alex/archive/2007/01/31/96831.htmlAlexAlexWed, 31 Jan 2007 01:06:00 GMThttp://www.aygfsteel.com/alex/archive/2007/01/31/96831.htmlhttp://www.aygfsteel.com/alex/comments/96831.htmlhttp://www.aygfsteel.com/alex/archive/2007/01/31/96831.html#Feedback4http://www.aygfsteel.com/alex/comments/commentRss/96831.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/96831.html
目里面有上传文g的需?我想了一下不外乎下面两种处理Ҏ:

1. 在数据库表中建立一个blob字段存放用户上传文g.
2. 在服务器上徏立一个文件夹保存用户上传文g,数据库表中只存放该文件的url地址.

我本人现在比较們֐于第2U方? 主要原因是担心方?的效率(我用的是mysql数据库)?但是处理q程中除了维护数据库中表的字D还要维护上传的文g,E微ȝ一炏V?/wbr>

大家在项目里面又是怎么做呢Q?l我点徏议!谢谢


讨论内容? javaeye

robin更徏议第二种ҎQ放在数据库中主要的问题?AppServer吃不消,开销比较?

上面是摘录,不过我们q里用的是Oracle9i AS,在Oracle的协作套间里一般文档或者上传的文g都是保存在数据库里,q把q个Ҏ作为Oracle 与别的协作套件之间不同的卖点?br>
大家以ؓ如何? 我直觉是Oracle的DB和oc4j的AppServer对付q个g没有开销上的担心Q但是没有实际检过?

换句话说Q文件的理是放在文件夹里方便还是数据库里方? 有点为难

update (2007-5-13):
q有一U方案结合了数据库和IOQ我认ؓ比较可行Q就是文件存在数据库Q但是下载的时候第一ơ从数据库下载,然后W一ơ这个文件保存在一个时文件夹下面Q以后每ơ下载的时候L先检查此临时文g夹,如果已经存在则直接下载,如果没有则从数据库重复这个动作。当Ӟ保存在时文件夹下的文g的命名需要唯一Q这个应该没有问题?/span>

Alex 2007-01-31 09:06 发表评论
]]>
web快速开发相x术和产品http://www.aygfsteel.com/alex/archive/2007/01/20/95088.htmlAlexAlexSat, 20 Jan 2007 14:56:00 GMThttp://www.aygfsteel.com/alex/archive/2007/01/20/95088.htmlhttp://www.aygfsteel.com/alex/comments/95088.htmlhttp://www.aygfsteel.com/alex/archive/2007/01/20/95088.html#Feedback2http://www.aygfsteel.com/alex/comments/commentRss/95088.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/95088.html
web快速开发是一个值得期待的东西,最早我接触q?span style="FONT-WEIGHT: bold">codecharge,是一个商业YӞ功能据说很强大,我试用过Q支持php,asp,jsp{多语言Q但是感觉对java的支持不是很手Q接着是asp,q个好也不好Q原因就不说了,因ؓ我对javax?br />
2. 接着是dorado ,刚看到的Q感觉也不错,有asp的风|不过更适合j2ee的环?,q里是他们的在线演示demo,有兴的可以看一?br />
3. 最后,刚google了一下,Oracle也有一个基于Oracle数据库的快速开发品?: APEX,Z览器做DB 开?原来的名字叫做HTML DB,名字很直观,据说Oracle的metalink是用这个实现的Q应该功能不赖?br />
4.对了Q再补充一个现在很热的QRor,听说javaeye的网站要重新用ruby1.2开发,试用q一点,感觉实令h震惊Q值得x?br />
java的技术其实是看着很热闹,比较大的东西也不,但是真正xwebq一块的其实不多Q无论是strutsq是webwork,L们所说的真正的“快速开发”的距离很远Q而以上一些工L出现也许会逐步改善j2ee在这一领域的现状?br />
我之所以对q个目前有点兴趣Q确实有一U强烈的反差在折着我,因ؓ我相信在j2ee的web开发里实存在本来要开?周多的工作量很可能用一个好的工具几个小时就搞定了,q是一件多么荒唐搞W的事情Q如果dorado在它的品中真的能做到这样那我们的java开发那么坑吃坑吃的折腾个什么劲? 也许真的有奇q,我宁愿相信有q样的奇qV?br />
大家有什么好的想法可以讨Z下?br />

Alex 2007-01-20 22:56 发表评论
]]>
[zt]注册comlghttp://www.aygfsteel.com/alex/archive/2006/12/20/89046.htmlAlexAlexWed, 20 Dec 2006 07:13:00 GMThttp://www.aygfsteel.com/alex/archive/2006/12/20/89046.htmlhttp://www.aygfsteel.com/alex/comments/89046.htmlhttp://www.aygfsteel.com/alex/archive/2006/12/20/89046.html#Feedback0http://www.aygfsteel.com/alex/comments/commentRss/89046.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/89046.html
最q项目中用到了收Ӟ需要在显上显C金?


1.?dll?ocx{考到system32下?br />2.用命令注册regsvr32.exe  .dll?eg:regsvr32.exe  OWC11.dll)
3.在注册表中查看:利用名称或与其唯一对应的clsid("clsid:0002E55D-0000-0000-C000-   000000000046")可查扑ֈ相关信息

Alex 2006-12-20 15:13 发表评论
]]>
workshop studio震撼你的开发效?[bea world2006 归来,谈感受,发牢骚]http://www.aygfsteel.com/alex/archive/2006/12/20/89003.htmlAlexAlexWed, 20 Dec 2006 03:39:00 GMThttp://www.aygfsteel.com/alex/archive/2006/12/20/89003.htmlhttp://www.aygfsteel.com/alex/comments/89003.htmlhttp://www.aygfsteel.com/alex/archive/2006/12/20/89003.html#Feedback10http://www.aygfsteel.com/alex/comments/commentRss/89003.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/89003.html
bea world 2006 北京已经q去好几天了Q早想记录一下一直忙 :)
  阅读全文

Alex 2006-12-20 11:39 发表评论
]]>
jstl标签注意问题http://www.aygfsteel.com/alex/archive/2006/12/11/86986.htmlAlexAlexMon, 11 Dec 2006 11:21:00 GMThttp://www.aygfsteel.com/alex/archive/2006/12/11/86986.htmlhttp://www.aygfsteel.com/alex/comments/86986.htmlhttp://www.aygfsteel.com/alex/archive/2006/12/11/86986.html#Feedback2http://www.aygfsteel.com/alex/comments/commentRss/86986.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/86986.html
原来一直用struts,最q项目里有h用jstl,我也顺便拿来用Q感觉还是不错?br />
q程中碰C些小的问题ȝ如下:

一。版本问?br />jstl存在1.0?.1的差异问题,用EL需要在1.1的版本下Q?.1的URI的标志ؓ:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

注意Q?.0版本没有/jsp/.

如果用的1.0会出现如下异?br />
org.apache.jasper.JasperException: /public/left_tree.jsp(100,24) According to TLD or attribute directive in tag file, attribute items does not accept any expressions
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:
510)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
375)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:
314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:
264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:
802)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:
75)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:
77)
    com.wellsoon.zfzw.webapp.common.VabAccessFilter.doFilter(VabAccessFilter.java:
43)


root cause 



二。打开QL

<%@ page contentType="text/html;charset=gb2312" language="java" isELIgnored="false" %>

前提是容器支持2Q0Q即使支持默认也未必打开Q最安全的方式就是显C打开 isELIgnored="false"

?fn的用?br />对于Vo里的一个List作length的计或判断很方?br />
<table width="160" border="0" cellspacing="0" cellpadding="4">
                        
<c:forEach items="${menuInfos}" var="m">
                            
<c:if test="${fn:length(m.subMenus)>0}">
                          
<tr>
                            
<td>
                                
<script language="JavaScript">
                                      
var tObj = new treeClass("A1")
                                      tObj.start();
                                     tObj.m_start(
"<c:out value="${m.menuModule}"/>",0);
                                    
<c:forEach items="${m.subMenus}" var="sub">
                                      tObj.add_Sub(
"<c:out value="${sub.menuName}"/>","<%=path%>
<c:out value=
"${sub.url}"/>","mymain");
                                    
</c:forEach>
                                     tObj.m_end();
                                      tObj.end();
                                      tObj.print();
                                 
</script>
                            
</td>
                        
</tr>
                            
</c:if>
                        
</c:forEach>

                    
</table>
 
?tld的声明可以在web.xml作显式声明也可以用http作直接URL声明
推荐用本地的方式.



Alex 2006-12-11 19:21 发表评论
]]>
解决response.sendRedirect("mypage.jsp")的问?/title><link>http://www.aygfsteel.com/alex/archive/2006/10/31/78244.html</link><dc:creator>Alex</dc:creator><author>Alex</author><pubDate>Tue, 31 Oct 2006 04:32:00 GMT</pubDate><guid>http://www.aygfsteel.com/alex/archive/2006/10/31/78244.html</guid><wfw:comment>http://www.aygfsteel.com/alex/comments/78244.html</wfw:comment><comments>http://www.aygfsteel.com/alex/archive/2006/10/31/78244.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.aygfsteel.com/alex/comments/commentRss/78244.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/alex/services/trackbacks/78244.html</trackback:ping><description><![CDATA[     摘要:   <a href='http://www.aygfsteel.com/alex/archive/2006/10/31/78244.html'>阅读全文</a><img src ="http://www.aygfsteel.com/alex/aggbug/78244.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/alex/" target="_blank">Alex</a> 2006-10-31 12:32 <a href="http://www.aygfsteel.com/alex/archive/2006/10/31/78244.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>用js实现打印和导ZؓExcelhttp://www.aygfsteel.com/alex/archive/2006/10/21/76526.htmlAlexAlexSat, 21 Oct 2006 04:19:00 GMThttp://www.aygfsteel.com/alex/archive/2006/10/21/76526.htmlhttp://www.aygfsteel.com/alex/comments/76526.htmlhttp://www.aygfsteel.com/alex/archive/2006/10/21/76526.html#Feedback0http://www.aygfsteel.com/alex/comments/commentRss/76526.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/76526.html
保存为Excel:

function saveAsExcel(HeadName, DivName) {
            
var s = "<center>" + HeadName + "</center>" + "\r\n";
            s 
+= DivName.innerHTML;
            
var xlsWindow = window.open("""_blank""width=1,height=1,scrollbars=no,toolbar=no");
            xlsWindow.document.write(s);
            xlsWindow.document.close();
            xlsWindow.document.execCommand('Saveas', 
true, '%homeDrive%\\Data.xls')
            xlsWindow.close();
        }


打印当前面:

function PrintDataSoure(HeadName1,HeadName2,HeadName3,DivName,TailName1) {
  
var oldBody=document.body.innerHTML;
  
var Div1=DivName.innerHTML;
  
var css = '<style type="text/css" media=all>+
  'p { line
-height: 120%}' +
  '.fhead {   font
-size: 9pt; text-decoration: none; color: 104A7B}' +
  '.ftitle { line
-height: 120%; font-size: 18px; color: #000000}' +
  'td { font
-size: 10px; color: #000000}' +
  '
</style>' ;

  
var body ='<table width="640" border="0" cellspacing="0" cellpadding="5">+
  ' 
<tr> ' +
  ' 
<td class="fbody">+
  ' 
<b><div align="center">'+'<font size="+1" class=fhead>'+ HeadName1 + '</div>'+'</font></b>'+
  ' 
<b><div align="center">'+'<font size="+1" class=fhead>'+ HeadName2 + '     ' + HeadName3 +'</div></font></b>'+
  ' 
</td>+
  ' 
</tr>+
  ' 
<tr> ' +
  ' 
<td class="fbody">+
  ' 
<div align="center" class=ftitle>+ Div1 + '</div>'+
  ' 
<b><div align="right">'+'<font size="+1" class=fhead>'+ '      </div>'+'</font></b>'+
  ' 
<b><div align="right">'+'<font size="+1" class=fhead>'+ TailName1 + '</div>'+'</font></b>'+
  ' 
</td>+
  ' 
</tr>+
  '
</table>';
document.body.innerHTML 
= '<center>+ css + body +'<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=0></OBJECT>'+'</center>';
wb.execwb(
6,6);
document.body.innerHTML
=oldBody;
}






Alex 2006-10-21 12:19 发表评论
]]>
[zt]关于Cookie跨域操作遇到的问题及解决Ҏhttp://www.aygfsteel.com/alex/archive/2006/09/18/70380.htmlAlexAlexMon, 18 Sep 2006 12:59:00 GMThttp://www.aygfsteel.com/alex/archive/2006/09/18/70380.htmlhttp://www.aygfsteel.com/alex/comments/70380.htmlhttp://www.aygfsteel.com/alex/archive/2006/09/18/70380.html#Feedback0http://www.aygfsteel.com/alex/comments/commentRss/70380.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/70380.html?关于跨域登陆cookie的问题在|上搜烦了一下,没看到有java下的CZQ这个asp的也可以参照一下,有空再在java下测一?

key words:单点登陆 SSO 跨域cookie


摘要Q?b>当你有一个Cookiel(或叫Cookie字典Q用Domain属性指定域名之后,当你在对该组的成员进行修Ҏ新增的时候,一定要在操 作之后加上Resonse.Cookies(CookieName).Domain属性。如果没有必要,请不要修改已讄Domain的Cookiel?
关键字:
正文Q?br />    Cookie跨域操作看来是个单的问题,因ؓ只要指定Domain属性ؓ指定|站的根域名可以了.但是W者在实际使用q程中却遇到了一些问题,的确值得注意.    环境介绍   cookie在wwwd名下创徏Qƈ写入Domain属性,如:(为方便调试以下代码皆为asp代码)   Write.asp <%
Response.Cookies(CookieName)("UserName") = "SunBird"
Response.Cookies(CookieName)("Password") = "xyz1234"
Response.Cookies(CookieName).Domain = "xxxx.com"
%>
  上面文g攑֜wwwd名下Q同时在同目录下攄一个读取cookie的Read.asp   Read.asp <%
Response.Write Request.Cookies(CookieName)("UserName")
Response.Write Request.Cookies(CookieName)("Password")
%>
  再放一个Read.asp文g到另外一个子域名站点里,代码同上。最后我们再做一个清除cookie的Clear.asp攑֜d名下   Clear.asp <%
Response.Cookies(CookieName)("UserName") = ""
Response.Cookies(CookieName)("Password") = ""
Response.Cookies(CookieName).Domain = "xxxx.com"
%>
  现在可以通过下面的执行顺序来试QWrite.asp-->d名的Read.asp-->子域名的Read.asp 所? Read.asp面都可以读取到Write.asp创徏的cookie的|然后再运行Clear.aspq行清除Q一切都OkQ看上去没有什么问题?/p'>   但是把这U方法运用到实际的站Ҏ却出现问题了?/p'>   问题描述Q?/p'>   W一ơ登录一切okQ所有子域名都可以访问到d名存储的cookieQ但是,一旦退Z后,子域名的cookie被清除了Q但是主域名? cookie仍然保留着Q强行清除主域名的cookie之后Q无论怎样dd名下都无法保存cookie了,除非x览器重新打开?/p'>   l过多次试之后Q无意中发现问题所在,以下是测试经q?/p'>   创徏一个Write2.asp的页面放在主域名?/p'> <%
Response.Cookies(CookieName)("TEST_COOKIE") = "TEST_COOKIE"
%>
  W一步:关闭览器后Q按以下序执行QWrite.asp-->d名的Read.asp-->子域名的Read.asp 到这里所有Read.aspd正常?/p'>   W二步:Clear.asp-->d名的Read.asp-->子域名的Read.asp 到这里清除操作是成功的?/p'>   W三步:Write.asp--> Write2.asp --> d名Read.asp --> 子域名Read.asp 到这里两个Read.asp都可以读取到cookie的倹{?/p'>   W四步:重新执行W二步,发现d名Read.asp仍然输出了|而子域名下的Read.asp的值已l被清空了?/p'>   Ҏ以上试ȝ以下几点再跨域用cookie旉要注意的地方   1、当你有一个Cookiel(或叫Cookie字典Q用Domain属性指定域名之后,当你在对该组的成员进行修Ҏ新增的时候,一定要在操作之后加上Resonse.Cookies(CookieName).Domain属性?/p'>   2、如果没有必要,请不要修改已讄Domain的Cookiel,直接使用Response.Cookies("CookieText") = CookieValue 来创Z个新的Cookie?br />

Alex 2006-09-18 20:59 发表评论
]]>
[zt]Struts国际化处?/title><link>http://www.aygfsteel.com/alex/archive/2006/09/05/67905.html</link><dc:creator>Alex</dc:creator><author>Alex</author><pubDate>Tue, 05 Sep 2006 14:22:00 GMT</pubDate><guid>http://www.aygfsteel.com/alex/archive/2006/09/05/67905.html</guid><wfw:comment>http://www.aygfsteel.com/alex/comments/67905.html</wfw:comment><comments>http://www.aygfsteel.com/alex/archive/2006/09/05/67905.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/alex/comments/commentRss/67905.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/alex/services/trackbacks/67905.html</trackback:ping><description><![CDATA[key words:struts国际?<br /><br /><p>一、Struts的国际化<br />    Struts是一U支持国际化的MVC的Web Framework。可是如何来使用struts国际化是一个问题。下面我们来探讨一下,如何实现Struts的国际化。WebE式的国际化涉及?个层面的东西。第一、jsp部分的输?输出Q第二、应用处理程序的国际化;W三、DB的国际化问题。这里主要探讨的是jsp部分的输?输出问题?/p><p>二、静态部分的国际?br />   Struts的jsp面静态内容(包括静态文字,静态图片)国际化问题,是通过资源文g来实现的。要实现国际化,需要做如下几项工作Q?、定义web.xml的动ActionServlet的参敎ͼ2、定义资源文Ӟ3、定义JSP面的字W集合;4、在JSP面获取资源文g里面的内宏V?br />1、定义web.xml的动ActionServlet的参?br /></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);"><</span><span style="color: rgb(128, 0, 0);">servlet</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />  </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">action</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />  </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet-class</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">org.apache.struts.action.ActionServlet</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet-class</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">   <br />  </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">init-param</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">param-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">config</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">param-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">param-value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">/WEB-INF/struts-config.xml</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">param-value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />  </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">init-param</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />  </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">init-param</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">param-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">application</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">param-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">param-value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">ApplicationResources</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">param-value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 128, 0);"><!--</span><span style="color: rgb(0, 128, 0);"> 默认资源文g名?/span><span style="color: rgb(0, 128, 0);">--></span><span style="color: rgb(0, 0, 0);"><br />  </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">init-param</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />  </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">load-on-startup</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">load-on-startup</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet</span><span style="color: rgb(0, 0, 255);">></span></div><br /><p>2、定义资源文?br />?WEB-INF/classes下面dUTF-8资源束文件。每一个资源文件是“键Q值”对的集合。在JSP面里面可以通过键来扑ֈ相应的数据倹{本例子的文件名是ApplicationResourcesQ所以相应的资源文g束是(包括e文,体中文,J体中文)<br />ApplicationResources.properties : 默认资源文g。当在其他资源文仉面找不到某个资源的时候,׃用该资源文g里面的定义?br /><font color="#ff0000">ApplicationResources_zh_CN.propertiesQ简体中文资源文件?br />ApplicationResources_zh_TW.propertiesQ繁体中文资源文件?/font><br />资源文g的格式ؓQ默认资源文件名_国别_语言.properties。其中每个文仉是通过<font color="#660000">%JAVA_HONE%/BIN/native2ascii.exe</font>工具转换而来。你也可以用其他工h处理得到(<a >http://java.sun.com/products/jilkit/</a> 有一个工具Internationalization Java Internationalization and Localization Toolkit 可以处理)。下面是一个例?我们昄如何使用%JAVA_HONE%/BIN/native2ascii.exe命o来定义资源束文g?br />2.1 准备文g<br />//ApplicationResources.properties Q默认资源文Ӟ通常里面的内Ҏ英文的?br />label.username=USERNAME :<br />label.password=PASSWORD :</p><p>//ApplicationResources_zh_CN.bak Q简体中文的资源文g。里面的内容是中文的。它需要工具将其中的内容处理成UTF-8<br />label.username=用户? :<br />label.password=密??:</p><p>//ApplicationResources_zh_TW.bak : J体中文的资源文件。里面的内容是中文的。它需要工具将其中的内容处理成UTF-8,下面的内ҎJ体码?br />label.username=ノめ?W :<br />label.password=ノめ?W :</p><p>2.2 准备完成以后Q用如下的命o创徏UTF-8资源文g?br /><font color="#ff0000">native2ascii -encoding gb2312 ApplicationResources_zh_CN.bak ApplicationResources_zh_CN.properties</font><br />native2ascii -encoding big5 Applica tionResources_zh_TW.bak ApplicationResources_zh_TW.properties</p><p>3、定义JSP面的字W集?br />定义JSP面的语a为UTF-8。在每个JSP面Q必L如下的内容(如果使用的模板技术,则只是需要在模板面dQ其他用该模板的页面无需dQ?br /><%@ page contentType="text/html;charset=UTF-8"%></p><p>4、在JSP面获取资源文g里面的内宏V?br />在JSP里面需要显C静态内容的地方使用<bean:message />strus的bean tag包里面的message标签。例如下面的面</p><p><table><br />  <tr><br />    <td align="right"><bean:message key="label.username" /></td>    <br />  </tr><br />  <tr><br />    <td align="right"><bean:message key="label.password" /></td><br />  </tr><br /></table></p><p>好了Q在q个面昄的时候,如果客户的IE的语a集合是zh_CN的话Q就会显C?br />用户名:<br />口?令:</p><p>如果是客LIE的语a是zh_TW的话Q就会显C?br />用户名:<br />用户名:</p><p>可以在IE的工?>Internet选项->语言的地方,来选择Q定义IE的语a?/p><p>三、表单的数据的处理?br /><b>对于表单数据的处理,我们是通过d一个Filter来实现的。所有提交的hQ都需要做字符处理。然后在web.xml里面定义该Filter。这h们就不需要在E序里面做Q何的字符处理?/b><br />3.1 定义Filter。下面是一个例子?br />package com.webapps.commons;</p><p>import java.io.*;<br />import javax.servlet.*;</p><p>public class CharsetEncodingFilter implements Filter{<br />  private FilterConfig config = null;<br />  private String defaultEncode = "UTF-8";</p><p>  public void init(FilterConfig config) throws ServletException {<br />    this.config = config;<br />    if(config.getInitParameter("Charset")!=null){<br />        defaultEncode=config.getInitParameter("Charset");<br />    }<br />  }</p><p>  public void destroy() {<br />    this.config = null;<br />  }</p><p>  public void doFilter(ServletRequest request, ServletResponse response,<br />                       FilterChain chain) throws IOException, ServletException {<br />    ServletRequest srequest=request;<br />    srequest.setCharacterEncoding(defaultEncode);<br />    chain.doFilter(srequest,response);<br />  }<br />}</p><p>3.2 在web.xml里面声明使用该Filter<br /><filter><br />  <filter-name>Character Encoding</filter-name><br />  <filter-class>com.webapps.commons.CharsetEncodingFilter</filter-class><br /></filter><br /><filter-mapping><br />  <filter-name>Character Encoding</filter-name><br />  <url-pattern>/*</url-pattern><br /></filter-mapping></p><p>四、扩?br />待箋的是应用E序部分的国际化问题Q和DB的国际化问题?/p><br /><img src ="http://www.aygfsteel.com/alex/aggbug/67905.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/alex/" target="_blank">Alex</a> 2006-09-05 22:22 <a href="http://www.aygfsteel.com/alex/archive/2006/09/05/67905.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[zt]l典正则表达?/title><link>http://www.aygfsteel.com/alex/archive/2006/08/29/66440.html</link><dc:creator>Alex</dc:creator><author>Alex</author><pubDate>Tue, 29 Aug 2006 07:02:00 GMT</pubDate><guid>http://www.aygfsteel.com/alex/archive/2006/08/29/66440.html</guid><wfw:comment>http://www.aygfsteel.com/alex/comments/66440.html</wfw:comment><comments>http://www.aygfsteel.com/alex/archive/2006/08/29/66440.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/alex/comments/commentRss/66440.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/alex/services/trackbacks/66440.html</trackback:ping><description><![CDATA[ <h1 align="center"> <font face="宋体" size="3"> <font style="color: rgb(0, 0, 0);" color="#414141">key wordsQ正则表辑ּ  模式匚w javascript</font> </font> </h1> <p> <font face="宋体" size="3"> <font style="color: rgb(0, 0, 0);" color="#414141">摘要Q收集一些常用的正则表达式?/font> </font> </p> <p> <font face="宋体" size="3"> <font style="color: rgb(0, 0, 0);" color="#414141">正则表达式用于字W串处理Q表单验证等场合Q实用高效,但用到时L不太把握Q以致往往要上|查一番。我一些常用的表达式收藏在q里Q作备忘之用。本贴随时会更新?/font> </font> </p> <p> <font face="宋体" size="3"> <font style="color: rgb(0, 0, 0);" color="#414141"> <font style="color: rgb(0, 0, 0);" color="#800080">匚w中文字符的正则表辑ּQ?[\u4e00-\u9fa5]</font> </font> </font> </p> <font face="宋体" size="3"> <font style="color: rgb(0, 0, 0);" color="#414141"> <font color="#000080"> <span style="color: rgb(0, 0, 0);"> <p> <font color="#000080">匚w双字节字W?包括汉字在内)Q[^\x00-\xff]</font> </p> <p> <font color="#000080">应用Q计字W串的长度(一个双字节字符长度?QASCII字符?Q?/font> </p> <p> <font color="#000080">String.prototype.len=function(){return this.replace([^\x00-\xff]/g,"aa").length;}</font> </p> <p> <font style="color: rgb(0, 0, 0);" color="#800080">匚wI的正则表辑ּQ\n[\s| ]*\r</font> </p> <p> <font color="#000080">匚wHTML标记的正则表辑ּQ?<(.*)>.*<\/\1>|<(.*) \/>/</font> <font color="#000000"> </font> </p> <font color="#000080"> </font> <p> <font color="#000080"> <font color="#800080">匚w首尾I格的正则表辑ּQ?^\s*)|(\s*$)</font> </font> </p> <p> <font color="#000080"> <font color="#800080">应用Qjavascript中没有像vbscript那样的trim函数Q我们就可以利用q个表达式来实现Q如下:</font> </font> </p> <p> <font color="#000080"> <font color="#800080">String.prototype.trim = function()<br /></font> </font> </p> </span> <font color="#800080">{<br />    return this.replace(/(^\s*)|(\s*$)/g, "");<br />}</font> </font> </font> </font> <p> <font face="宋体" size="3"> <font style="color: rgb(0, 0, 0);" color="#414141"> <font color="#000080"> <font color="#000080">利用正则表达式分解和转换IP地址Q?/font> </font> </font> </font> </p> <p> <font face="宋体" size="3"> <font style="color: rgb(0, 0, 0);" color="#414141"> <font color="#000080"> <font color="#000080">下面是利用正则表辑ּ匚wIP地址QƈIP地址转换成对应数值的javascriptE序Q?/font> </font> </font> </font> </p> <p> <font face="宋体" size="3"> <font style="color: rgb(0, 0, 0);" color="#414141"> <font color="#000080"> <font color="#000080">function IP2V(ip)<br />{<br /> re=/(\d+)\.(\d+)\.(\d+)\.(\d+)/g  //匚wIP地址的正则表辑ּ<br />if(re.test(ip))<br />{<br />return RegExp.$1*Math.pow(255,3))+RegExp.$2*Math.pow(255,2))+RegExp.$3*255+RegExp.$4*1<br />}<br />else<br />{<br /> throw new Error("Not a valid IP address!")<br />}<br />}</font> </font> </font> </font> </p> <p> <font face="宋体" size="3"> <font style="color: rgb(0, 0, 0);" color="#414141"> <font color="#000080"> <font color="#000080">不过上面的程序如果不用正则表辑ּQ而直接用split函数来分解可能更单,E序如下Q?/font> </font> </font> </font> </p> <p> <font face="宋体" size="3"> <font style="color: rgb(0, 0, 0);" color="#414141"> <font color="#000080"> <font color="#000080">var ip="10.100.20.168"<br />ip=ip.split(".")<br />alert("IP值是Q?+(ip[0]*255*255*255+ip[1]*255*255+ip[2]*255+ip[3]*1))</font> </font> </font> </font> </p> <p> <font face="宋体" size="3"> <font style="color: rgb(0, 0, 0);" color="#414141"> <font color="#000080"> <font color="#800080">匚wEmail地址的正则表辑ּQ\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*</font> </font> </font> </font> </p> <p> <font face="宋体" size="3"> <font style="color: rgb(0, 0, 0);" color="#414141"> <font color="#000080"> <font color="#000080">匚w|址URL的正则表辑ּQhttp://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?</font> </font> </font> </font> </p> <p> <font face="宋体" size="3"> <font style="color: rgb(0, 0, 0);" color="#414141"> <font color="#000080"> <font color="#000080">得用正则表达式从URL地址中提取文件名的javascriptE序Q如下结果ؓpage1</font> </font> </font> </font> </p> <p> <font face="宋体" size="3"> <font style="color: rgb(0, 0, 0);" color="#414141"> <font color="#000080"> <font color="#800080"> <font color="#000080">s="http://www.9499.net/page1.htm"<br />s=s.replace(/(.*\/){0,}([^\.]+).*/ig,"$2")<br />alert(s)</font> </font> </font> </font> </font> </p> <font face="宋体" size="3"> <font style="color: rgb(0, 0, 0);" color="#414141"> <font color="#000080"> <font color="#800080"> <span style="color: rgb(0, 0, 0);"> <p> <font color="#800080">利用正则表达式限制网表单里的文本框输入内容Q?/font> </p> <p> <font color="#800080">用正则表辑ּ限制只能输入中文Qonkeyup="value=value.replace(/[^ \u4E00-\u9FA5]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\u4E00-\u9FA5]/g,''))"</font> </p> <p> <font color="#800080">用正则表辑ּ限制只能输入全角字符Q?/font> <font color="#800080"> onkeyup="value=value.replace(/[^\uFF00-\uFFFF]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\uFF00-\uFFFF]/g,''))"</font> </p> <p> <font color="#800080">用正则表辑ּ限制只能输入数字Qonkeyup="value=value.replace(/[^ \d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"</font> </p> <p> <font color="#800080">用正则表辑ּ限制只能输入数字和英文:onkeyup="value=value.replace (/[\W]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"<br /><br />"^\\d+$"  //非负整数Q正整数 + 0Q?br />"^[0-9]*[1-9][0-9]*$"  //正整?<br />"^((-\\d+)|(0+))$"  //非正整数Q负整数 + 0Q?<br />"^-[0-9]*[1-9][0-9]*$"  //负整?<br />"^-?\\d+$"    //整数 <br />"^\\d+(\\.\\d+)?$"  //非负点敎ͼ正QҎ + 0Q?<br />"^(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))$"  //正QҎ <br />"^((-\\d+(\\.\\d+)?)|(0+(\\.0+)?))$"  //非正点敎ͼ负QҎ + 0Q?<br />"^(-(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*)))$"  //负QҎ <br />"^(-?\\d+)(\\.\\d+)?$"  //点?<br />"^[A-Za-z]+$"  //?6个英文字母组成的字符?<br />"^[A-Z]+$"  //?6个英文字母的大写l成的字W串 <br />"^[a-z]+$"  //?6个英文字母的写l成的字W串 <br />"^[A-Za-z0-9]+$"  //由数字和26个英文字母组成的字符?<br />"^\\w+$"  //由数字?6个英文字母或者下划线l成的字W串 <br />"^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$"    //email地址 <br />"^[a-zA-z]+://(\\w+(-\\w+)*)(\\.(\\w+(-\\w+)*))*(\\?\\S*)?$"  //url<br /><br />"^[A-Za-z0-9_]*$"</font> </p> </span> </font> </font> </font> </font> <img src ="http://www.aygfsteel.com/alex/aggbug/66440.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/alex/" target="_blank">Alex</a> 2006-08-29 15:02 <a href="http://www.aygfsteel.com/alex/archive/2006/08/29/66440.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[zt]深入出之正则表辑ּhttp://www.aygfsteel.com/alex/archive/2006/08/28/66316.htmlAlexAlexMon, 28 Aug 2006 15:21:00 GMThttp://www.aygfsteel.com/alex/archive/2006/08/28/66316.htmlhttp://www.aygfsteel.com/alex/comments/66316.htmlhttp://www.aygfsteel.com/alex/archive/2006/08/28/66316.html#Feedback0http://www.aygfsteel.com/alex/comments/commentRss/66316.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/66316.html阅读全文

Alex 2006-08-28 23:21 发表评论
]]>
[zt]解放webE序员的输入验证http://www.aygfsteel.com/alex/archive/2006/08/28/66299.htmlAlexAlexMon, 28 Aug 2006 14:20:00 GMThttp://www.aygfsteel.com/alex/archive/2006/08/28/66299.htmlhttp://www.aygfsteel.com/alex/comments/66299.htmlhttp://www.aygfsteel.com/alex/archive/2006/08/28/66299.html#Feedback0http://www.aygfsteel.com/alex/comments/commentRss/66299.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/66299.html阅读全文

Alex 2006-08-28 22:20 发表评论
]]>
js:window.opener问题http://www.aygfsteel.com/alex/archive/2006/08/23/65225.htmlAlexAlexWed, 23 Aug 2006 02:54:00 GMThttp://www.aygfsteel.com/alex/archive/2006/08/23/65225.htmlhttp://www.aygfsteel.com/alex/comments/65225.htmlhttp://www.aygfsteel.com/alex/archive/2006/08/23/65225.html#Feedback0http://www.aygfsteel.com/alex/comments/commentRss/65225.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/65225.html在AH口中打开BH口Q在BH口中操作完以后关闭BH口Q同时自动刷新AH口


function closeWin(){
        hasClosed 
= true;
        window.opener.location
="javascript:reloadPage();";
        window.close();
    }
    
function window.onbeforeunload(){
        
if(!hasClosed){
            window.opener.location
="javascript:reloadPage();";
        }
    }

</script>

上面的代码在关闭BH口的时候会提示错误Q说~少Object,正确的代码如下:
function closeWin(){
        hasClosed 
= true;
        window.opener.location
="javascript:reloadPage();";
        window.opener
=null;
        window.close();
    }
    
function window.onbeforeunload(){
        
if(!hasClosed){//如果已经执行了closeWinҎQ则不执行本Ҏ
            window.opener.location
="javascript:reloadPage();";
        }
    }

</script>

reloadPageҎ如下:
function reloadPage() {
        history.go(
0);
        document.execCommand(
"refresh")
        document.location 
= document.location;
        document.location.reload();
    }

PS:׃需要支持正常关闭和强制关闭H口时能捕捉CӞ用了全局变量hasClosed

==============================================

补充Q在父窗口是frame的时候在h父窗口的时候会出现问题:

The page cannot be refreshed without resending the information.

后修改如?
window.opener.parent.document.frames.item('mainFrame').location.href = window.opener.location.href;

不需要执行自带的reload()Ҏ,注意Q不要再画蛇添加上q一?

window.opener.parent.document.frames.item('mainFrame').location.reload();

========================================================================================
最后,Z同时支持h普通父H口和frame父窗口,代码如下:
function closeWin() {
        hasClosed 
= true;
    
<%if(null != frame){%>
        window.opener.parent.document.frames.item('mainFrame').location.href 
= window.opener.location.href;
    
<%}else{%>
        window.opener.location 
= "javascript:reloadPage();";
    
<%}%>
        
//window.opener.top.mainFrame.location="javascript:reloadPage();";
        //self.opener.frames.mainFrame.location.reload(true);
        window.opener = null;
        window.close();
    }
    
function window.onbeforeunload(){
        
if (!hasClosed) {
        
<%if(null != frame){%>
            window.opener.parent.document.frames.item('mainFrame').location.href 
= window.opener.location.href;
        
<%}else{%>
            window.opener.location 
= "javascript:reloadPage();";
        
<%}%>
            window.opener 
= null;
        }
    }






Alex 2006-08-23 10:54 发表评论
]]>
jsQ获得select的text的?/title><link>http://www.aygfsteel.com/alex/archive/2006/08/21/64903.html</link><dc:creator>Alex</dc:creator><author>Alex</author><pubDate>Mon, 21 Aug 2006 14:58:00 GMT</pubDate><guid>http://www.aygfsteel.com/alex/archive/2006/08/21/64903.html</guid><wfw:comment>http://www.aygfsteel.com/alex/comments/64903.html</wfw:comment><comments>http://www.aygfsteel.com/alex/archive/2006/08/21/64903.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/alex/comments/commentRss/64903.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/alex/services/trackbacks/64903.html</trackback:ping><description><![CDATA[key words:select text?br />获得select的value很容易,但是如何获得其text的内容呢Q下面的代码借助了prototype.js?<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);"><</span><span style="color: rgb(128, 0, 0);">script </span><span style="color: rgb(255, 0, 0);">language</span><span style="color: rgb(0, 0, 255);">="javascript"</span><span style="color: rgb(0, 0, 255);">></span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"><br />        </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">function</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> getSelect(selectName){<br />        </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">var</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> options </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> $(selectName).getElementsByTagName('option');<br />        options </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> $A(options);<br />        </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">var</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> opt </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> options.find( </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">function</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">(employee){<br />            </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">return</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> (employee.value </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">==</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> $F(selectName));<br />        });<br />        alert(opt.innerHTML);<br />        }<br />    </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">script</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">select </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="hi"</span><span style="color: rgb(255, 0, 0);"> onchange</span><span style="color: rgb(0, 0, 255);">="getSelect('hi');"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />                </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">option </span><span style="color: rgb(255, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">="01"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">一</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">option</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />                </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">option </span><span style="color: rgb(255, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">="02"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">?/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">option</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />                </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">option </span><span style="color: rgb(255, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">="03"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">?/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">option</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />                </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">option </span><span style="color: rgb(255, 0, 0);">value</span><span style="color: rgb(0, 0, 255);">="04"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">?/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">option</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">select</span><span style="color: rgb(0, 0, 255);">></span></div><br />PS: $A : 转换成数l格?br />    opt.innerHTML:nodeText<br /><img src ="http://www.aygfsteel.com/alex/aggbug/64903.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/alex/" target="_blank">Alex</a> 2006-08-21 22:58 <a href="http://www.aygfsteel.com/alex/archive/2006/08/21/64903.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>js : 怎样从子H口调用父窗口的Ҏhttp://www.aygfsteel.com/alex/archive/2006/08/21/64894.htmlAlexAlexMon, 21 Aug 2006 13:55:00 GMThttp://www.aygfsteel.com/alex/archive/2006/08/21/64894.htmlhttp://www.aygfsteel.com/alex/comments/64894.htmlhttp://www.aygfsteel.com/alex/archive/2006/08/21/64894.html#Feedback0http://www.aygfsteel.com/alex/comments/commentRss/64894.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/64894.html
parent.window.show(b)
window.opener.show(b)

都不?正确的做法是:
opener.location="javascript:show('hello')";

PS: 直接调用父窗口的对象与此不同Q参考这? 用javaScript操作两个面



Alex 2006-08-21 21:55 发表评论
]]>
js中获取radio的?/title><link>http://www.aygfsteel.com/alex/archive/2006/08/21/64861.html</link><dc:creator>Alex</dc:creator><author>Alex</author><pubDate>Mon, 21 Aug 2006 11:12:00 GMT</pubDate><guid>http://www.aygfsteel.com/alex/archive/2006/08/21/64861.html</guid><wfw:comment>http://www.aygfsteel.com/alex/comments/64861.html</wfw:comment><comments>http://www.aygfsteel.com/alex/archive/2006/08/21/64861.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/alex/comments/commentRss/64861.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/alex/services/trackbacks/64861.html</trackback:ping><description><![CDATA[key words: radio的?Form<br /><br />在jsp中获取radio的值很ҎQ直?request.getParameter("myRadio");<br />但是在js中不行,我试验了一下,如果选择W一个没问题Q但是你选第二个W三个的话就出现undefined.办法如下:<br /><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);">function</span><span style="color: rgb(0, 0, 0);"> Foo()<br />{<br />    </span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"> selectedIndex </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;<br />    </span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"> form1 </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> document.getElementById(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">form1</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />    </span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"> i </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br />    <br />    </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);"> (i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">; i</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">form1.r.length; i</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">)<br />    {<br />        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (form1.r[i].checked)<br />        {<br />            selectedIndex </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> i;<br />            alert(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">您选择的 value 是:</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> form1.r[i].value);<br />            </span><span style="color: rgb(0, 0, 255);">break</span><span style="color: rgb(0, 0, 0);">;<br />        }<br />    }<br />    <br />    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (selectedIndex </span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">)<br />    {<br />        alert(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">您没有选择M?/span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />    }<br />}</span></div><br /><br /><img src ="http://www.aygfsteel.com/alex/aggbug/64861.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/alex/" target="_blank">Alex</a> 2006-08-21 19:12 <a href="http://www.aygfsteel.com/alex/archive/2006/08/21/64861.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>textarea的弱智问?/title><link>http://www.aygfsteel.com/alex/archive/2006/08/15/63634.html</link><dc:creator>Alex</dc:creator><author>Alex</author><pubDate>Tue, 15 Aug 2006 03:08:00 GMT</pubDate><guid>http://www.aygfsteel.com/alex/archive/2006/08/15/63634.html</guid><wfw:comment>http://www.aygfsteel.com/alex/comments/63634.html</wfw:comment><comments>http://www.aygfsteel.com/alex/archive/2006/08/15/63634.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/alex/comments/commentRss/63634.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/alex/services/trackbacks/63634.html</trackback:ping><description><![CDATA[key words : textareaI格问题 <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);"><</span><span style="color: rgb(128, 0, 0);">textarea </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="parentRemark"</span><span style="color: rgb(255, 0, 0);"> rows</span><span style="color: rgb(0, 0, 255);">="10"</span><span style="color: rgb(255, 0, 0);"> cols</span><span style="color: rgb(0, 0, 255);">="80"</span><span style="color: rgb(255, 0, 0);"> class</span><span style="color: rgb(0, 0, 255);">="editor"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"><%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 128, 0);">rem</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 128, 0);">[7]==null?"":rem[7]%><br /></textarea></span></div><br />猜猜q个textarea会有什么问?<br /><br />效果如下:<br /><br /><img src="http://www.aygfsteel.com/images/blogjava_net/alex/images/jiazhang.png" alt="jiazhang.png" border="0" height="250" width="736" /><br /><br />是不是很奇怪,哪来的空格啊Q还以ؓ从数据库中取出的数据有空|查也不是Q后来才知道Q原来是textarea换行惹得?不换行就OK?br /><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);"><</span><span style="color: rgb(128, 0, 0);">textarea </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="parentRemark"</span><span style="color: rgb(255, 0, 0);"> rows</span><span style="color: rgb(0, 0, 255);">="10"</span><span style="color: rgb(255, 0, 0);"> cols</span><span style="color: rgb(0, 0, 255);">="80"</span><span style="color: rgb(255, 0, 0);"> class</span><span style="color: rgb(0, 0, 255);">="editor"</span><span style="color: rgb(0, 0, 255);">></span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"><%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 128, 0);">rem</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 128, 0);">[7]==null?"":rem[7]%></textarea></span></div><br /><img src ="http://www.aygfsteel.com/alex/aggbug/63634.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/alex/" target="_blank">Alex</a> 2006-08-15 11:08 <a href="http://www.aygfsteel.com/alex/archive/2006/08/15/63634.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转]js实现捕捉退出浏览器行ؓhttp://www.aygfsteel.com/alex/archive/2006/07/20/59137.htmlAlexAlexThu, 20 Jul 2006 02:50:00 GMThttp://www.aygfsteel.com/alex/archive/2006/07/20/59137.htmlhttp://www.aygfsteel.com/alex/comments/59137.htmlhttp://www.aygfsteel.com/alex/archive/2006/07/20/59137.html#Feedback0http://www.aygfsteel.com/alex/comments/commentRss/59137.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/59137.html
有时在用户session理Ӟ需要跟t会话状态,比如当前在线用户Q如果用户非正常退出,需要知道?br />
用js控制览器的关闭是一个辅助的手段Q当然也可以讄session的有效期Q不q不够及时?br />
js代码如下:

<html>
<script language="javascript"> 
<!-- 
var s="close"
function window.onunload(){ 
    
if(s=="fresh"
        
if(window.screenLeft>10000){alert('¹ØuÕ');}
        
else{alert('ËÐÂ');} 
    
else alert('¹ØuÕ'); 

function window.onbeforeunload()

    s
="fresh"

--> 
</script>
</html>



Alex 2006-07-20 10:50 发表评论
]]>
差点被遗忘的元素:cookie-用cookie记录用户的历史行?/title><link>http://www.aygfsteel.com/alex/archive/2006/07/05/56832.html</link><dc:creator>Alex</dc:creator><author>Alex</author><pubDate>Wed, 05 Jul 2006 09:39:00 GMT</pubDate><guid>http://www.aygfsteel.com/alex/archive/2006/07/05/56832.html</guid><wfw:comment>http://www.aygfsteel.com/alex/comments/56832.html</wfw:comment><comments>http://www.aygfsteel.com/alex/archive/2006/07/05/56832.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/alex/comments/commentRss/56832.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/alex/services/trackbacks/56832.html</trackback:ping><description><![CDATA[key words: cookie 保留历史记录 登陆记录<br /><br />很多时候用session觉得挺方便的Q今天突然发现自q然几乎没用过cookieQ呵呵,有点意思。正好碰C个登陆页面,需要用户选择站点cdQ觉得每ơ都让用户选择有点不合理,毕竟一个用户常用的׃个,所以决定用cookie记录下这个站点,下次登陆的时候可以直接显C?<br /><br />效果如下:<br /><img src="http://www.aygfsteel.com/images/blogjava_net/alex/cookie/siteCookie.jpg" alt="站点cookie" title="站点cookie" border="0" height="151" width="211" /><br /><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, 0);"> </span><span style="color: rgb(0, 128, 0);">/**</span><span style="color: rgb(0, 128, 0);"><br />     * 从cookie里读取指定Name 对应的?br />     * 如果没有q回I null<br />     * </span><span style="color: rgb(128, 128, 128);">@param</span><span style="color: rgb(0, 128, 0);"> cookieName<br />     * </span><span style="color: rgb(128, 128, 128);">@param</span><span style="color: rgb(0, 128, 0);"> request<br />     * </span><span style="color: rgb(0, 128, 0);"></span><span style="color: rgb(128, 128, 128);">@param</span><span style="color: rgb(0, 128, 0);"> decode :~码</span><br /><span style="color: rgb(0, 128, 0);">     * </span><span style="color: rgb(128, 128, 128);">@return</span><span style="color: rgb(0, 128, 0);">  String<br />     </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);"> String getCookieValue(String cookieName, HttpServletRequest request,String decode) {<br />        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);"> cookieName </span><span style="color: rgb(0, 0, 0);">||</span><span style="color: rgb(0, 0, 0);"> cookieName.trim().length() </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">) </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">""</span><span style="color: rgb(0, 0, 0);">;<br />        Cookie cookies[] </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> request.getCookies();<br />        Cookie sCookie </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br />        String sname </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br />        String svalue </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br />        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);"> cookies </span><span style="color: rgb(0, 0, 0);">&&</span><span style="color: rgb(0, 0, 0);"> cookies.length </span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">) {<br />            </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">; i </span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);"> cookies.length; i</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">) {<br />                sCookie </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> cookies[i];<br />                sname </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> sCookie.getName();<br />                </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (cookieName.equals(sname)) {<br />                    </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br />                        svalue </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> java.net.URLDecoder.decode(sCookie.getValue(),decode);<br />                    } </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (UnsupportedEncodingException e) {<br />                        e.printStackTrace();  <br />                    }<br />                    </span><span style="color: rgb(0, 0, 255);">break</span><span style="color: rgb(0, 0, 0);">;<br />                }<br />            }<br />        }<br />        </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> svalue ;<br />    }<br /><br />    </span><span style="color: rgb(0, 128, 0);">/**</span><span style="color: rgb(0, 128, 0);"><br />     * 讄cookie<br />     * </span><span style="color: rgb(128, 128, 128);">@param</span><span style="color: rgb(0, 128, 0);"> cookieName<br />     * </span><span style="color: rgb(128, 128, 128);">@param</span><span style="color: rgb(0, 128, 0);"> cookieValue<br />     * </span><span style="color: rgb(128, 128, 128);">@param</span><span style="color: rgb(0, 128, 0);"> maxAge<br />     * </span><span style="color: rgb(128, 128, 128);">@param</span><span style="color: rgb(0, 128, 0);"> response<br /></span><span style="color: rgb(0, 128, 0);">     * </span><span style="color: rgb(0, 128, 0);"></span><span style="color: rgb(128, 128, 128);">@param</span><span style="color: rgb(0, 128, 0);"></span><span style="color: rgb(0, 0, 0);">encode </span><span style="color: rgb(0, 128, 0);">:~码</span><br /><span style="color: rgb(0, 128, 0);">     </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> setCookieValue(String cookieName,String cookieValue,<br /></span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> maxAge,HttpServletResponse response,String encode) {<br />        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);"> cookieName </span><span style="color: rgb(0, 0, 0);">||</span><span style="color: rgb(0, 0, 0);"> cookieName.trim().length() </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">) </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> ;<br />        Cookie cookie </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br />        </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br />            cookie </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> Cookie(cookieName, java.net.URLEncoder.encode(cookieValue,encode));<br />        } </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (UnsupportedEncodingException e) {<br />            e.printStackTrace();<br />        }<br />        cookie.setMaxAge(maxAge);<br />        response.addCookie(cookie);<br />    }</span></div><br /><img src ="http://www.aygfsteel.com/alex/aggbug/56832.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/alex/" target="_blank">Alex</a> 2006-07-05 17:39 <a href="http://www.aygfsteel.com/alex/archive/2006/07/05/56832.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>prototype.js记http://www.aygfsteel.com/alex/archive/2006/06/18/53654.htmlAlexAlexSun, 18 Jun 2006 14:22:00 GMThttp://www.aygfsteel.com/alex/archive/2006/06/18/53654.htmlhttp://www.aygfsteel.com/alex/comments/53654.htmlhttp://www.aygfsteel.com/alex/archive/2006/06/18/53654.html#Feedback0http://www.aygfsteel.com/alex/comments/commentRss/53654.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/53654.html
Prototype.js--Javascript~写者的军刀




Alex 2006-06-18 22:22 发表评论
]]>
利用css实现表格的隔行换?/title><link>http://www.aygfsteel.com/alex/archive/2006/06/15/53057.html</link><dc:creator>Alex</dc:creator><author>Alex</author><pubDate>Thu, 15 Jun 2006 10:14:00 GMT</pubDate><guid>http://www.aygfsteel.com/alex/archive/2006/06/15/53057.html</guid><wfw:comment>http://www.aygfsteel.com/alex/comments/53057.html</wfw:comment><comments>http://www.aygfsteel.com/alex/archive/2006/06/15/53057.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.aygfsteel.com/alex/comments/commentRss/53057.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/alex/services/trackbacks/53057.html</trackback:ping><description><![CDATA[key words: css  隔行换色 控制表格  交替颜色<br /><br />最q用Ccss的东西,发现用css是可以省不少ȝQ特别更Ҏ果?br /><br />google了一 <a target="_blank" class="" title="" ><font class="headertitle"><span id="ctq">利用CSS控制表格的交曉K?/span></font></a><br /><br />下面是实现的代码:<br /><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);"><</span><span style="color: rgb(128, 0, 0);">style </span><span style="color: rgb(255, 0, 0);">type</span><span style="color: rgb(0, 0, 255);">="text/css"</span><span style="color: rgb(0, 0, 255);">></span><span style="background-color: rgb(245, 245, 245); color: rgb(128, 0, 0);"><br /><!--<br />tr </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">{</span><span style="background-color: rgb(245, 245, 245); color: rgb(255, 0, 0);">background-color</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">:</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">expression((this.sectionRowIndex==0)?"":<br />(this.sectionRowIndex%2==0)?"red":"blue")</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">}</span><span style="background-color: rgb(245, 245, 245); color: rgb(128, 0, 0);"><br />--><br /></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">style</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">HEAD</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">table</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">table</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span></div><br />关键是q一?<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, 0);">tr {background-color:expression((this.sectionRowIndex==0)?"":<br />(this.sectionRowIndex%2==0)?"red":"blue")}</span></div><br /><br />对于td的控制如?<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);"><</span><span style="color: rgb(128, 0, 0);">style </span><span style="color: rgb(255, 0, 0);">type</span><span style="color: rgb(0, 0, 255);">="text/css"</span><span style="color: rgb(0, 0, 255);">></span><span style="background-color: rgb(245, 245, 245); color: rgb(128, 0, 0);"><br /><!--<br />tr </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">{</span><span style="background-color: rgb(245, 245, 245); color: rgb(255, 0, 0);">background-color</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">:</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">expression((this.sectionRowIndex%2==0)?"red":"blue")</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">}</span><span style="background-color: rgb(245, 245, 245); color: rgb(128, 0, 0);"><br />td </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">{</span><span style="background-color: rgb(245, 245, 245); color: rgb(255, 0, 0);">background-color</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">:</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">expression((this.cellIndex%2==0)?"":((this.parentElement.sectionRowIndex%2==0)?"green":"yellow"))</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">}</span><span style="background-color: rgb(245, 245, 245); color: rgb(128, 0, 0);"><br />--><br /></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">style</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">HEAD</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">table</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);"> /td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);"> /td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);"> /td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);"> /td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);"> /td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">><</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">W??/span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">table</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span></div><br />?span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">cellIndex <br /><br />?和数l一PW一行从0开?br /><br /><br /><br />但愿对你有用.  :)<br /><br /><br /><br /></span><img src ="http://www.aygfsteel.com/alex/aggbug/53057.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/alex/" target="_blank">Alex</a> 2006-06-15 18:14 <a href="http://www.aygfsteel.com/alex/archive/2006/06/15/53057.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>jsp实现文g下蝲与中文文件名q问题解决http://www.aygfsteel.com/alex/archive/2006/06/14/52855.htmlAlexAlexWed, 14 Jun 2006 14:48:00 GMThttp://www.aygfsteel.com/alex/archive/2006/06/14/52855.htmlhttp://www.aygfsteel.com/alex/comments/52855.htmlhttp://www.aygfsteel.com/alex/archive/2006/06/14/52855.html#Feedback13http://www.aygfsteel.com/alex/comments/commentRss/52855.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/52855.html
文g上传参看: q里

到文gqQgoogle了一下,发现q篇文章q不?br />
摘录如下:


之前,写过一个Download.jsp文g,可以解决下蝲文gq问题(诸如:DOC,XSL文g{等).
后来发现,遇到中文名的文g的时?文g下蝲会报错~~~~
今天,通过改写原Download.jsp文g已经d解决了这个问题~
现在,把一整套的文件上传下载的Ҏl脓出来~~~以便大家借鉴!~!~!~!~! 
作?古埃及法?br />
download.jsp文g
---------------------------------------------------------
<%
  java.io.BufferedInputStream bis
=null;
  java.io.BufferedOutputStream  bos
=null;
try{
 
String filename=request.getParameter("filename");
             filename
=new String(filename.getBytes("iso8859-1"),"gb2312");
 response.setContentType(
"application/x-msdownload");
 response.setHeader(
"Content-disposition","attachment; filename="+new String(filename.getBytes("gb2312"),"iso8859-1"));
 bis 
=new java.io.BufferedInputStream(new java.io.FileInputStream(config.getServletContext().getRealPath("files/" + filename)));
 bos
=new java.io.BufferedOutputStream(response.getOutputStream()); 
 
byte[] buff = new byte[2048];
 
int bytesRead;
 
while(-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
  bos.write(buff,
0,bytesRead);
 }
}
catch(Exception e){
 e.printStackTrace();
}
finally {
 
if (bis != null)bis.close();
 
if (bos != null)bos.close();
}
%> 


注意Q关键就?span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">setHeader里的filename需要重新编?格式是ISO-8859-1OQ了

以下是我自己目中用到的代码片断Q供参?

list.jsp: 昄附g名称的页?br />
<tr>
            
<td height="25" class="tdcor">?/span>&nbsp;&nbsp;?/span>&nbsp;</td>
            
<td colspan="3" height=50>
                
<%
                    
if (null != publish.getAttatchFilename() &&
publish.getAttatchFilename().length() 
> 0) {
                
%>
                
<href="publish_do.jsp?method=download&fileName=
<%=URLEncoder.encode(publish.getAttatchFilename(),"
GBK")%>">
<%
=URLDecoder.decode(publish.getAttatchFilename(),"GBK")%></a>
                
<%
                    }
                
%>
            
</td>
</tr>

download.jsp:下蝲面
else if (null != method && method.equals("download")) {//下蝲附g

        String fileName 
= request.getParameter("fileName");
        File file 
= new File(Constants.PUBLISH_FILE_PATH + "/" + URLDecoder.decode(fileName,"GBK"));
        response.reset();
        response.setContentType(
"application/octet-stream; charset=GBK");
        response.addHeader(
"Content-Disposition""attachment; filename=" + CourseDetailBusiness.transfer(URLDecoder.decode(fileName,"GBK"),"GBK","ISO-8859-1"));
        response.setContentLength((
int) file.length());

        
byte[] buffer = new byte[4096];
        BufferedOutputStream output 
= null;
        BufferedInputStream input 
= null;

        
// 写缓冲区Q?/span>
        try {
            output 
= new BufferedOutputStream(response.getOutputStream());
            input 
= new BufferedInputStream(new FileInputStream(file));

            
int n = (-1);
            
while ((n = input.read(buffer, 04096)) > -1) {
                output.write(buffer, 
0, n);
            }
            response.flushBuffer();
        }
        
catch (Exception e) {
        } 
// maybe user cancelled download
        finally {
            
if (input != null) input.close();
            
if (output != null) output.close();
        }


说明:
Q。文件名在数据库中保存的~码为URLEncode
2.在list.jsp昄的时候多了一ơencode,不知Z么,不encode一ơ还不行Q实际上是第二次~码?br />



Alex 2006-06-14 22:48 发表评论
]]>
奇的javaScript实现的无需服务器支持的WIKIhttp://www.aygfsteel.com/alex/archive/2006/06/11/52004.htmlAlexAlexSun, 11 Jun 2006 07:38:00 GMThttp://www.aygfsteel.com/alex/archive/2006/06/11/52004.htmlhttp://www.aygfsteel.com/alex/comments/52004.htmlhttp://www.aygfsteel.com/alex/archive/2006/06/11/52004.html#Feedback3http://www.aygfsteel.com/alex/comments/commentRss/52004.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/52004.html阅读全文

Alex 2006-06-11 15:38 发表评论
]]>
[转]CSS入门http://www.aygfsteel.com/alex/archive/2006/06/05/50425.htmlAlexAlexMon, 05 Jun 2006 01:53:00 GMThttp://www.aygfsteel.com/alex/archive/2006/06/05/50425.htmlhttp://www.aygfsteel.com/alex/comments/50425.htmlhttp://www.aygfsteel.com/alex/archive/2006/06/05/50425.html#Feedback0http://www.aygfsteel.com/alex/comments/commentRss/50425.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/50425.htmlkey words:  css


转自:http://www.blueidea.com/tech/site/2004/1928.asp

在了解XHTML代码规范后,我们pq行CSS布局。首先先介绍一些CSS的入门知识。如果你已经很熟悉了Q可以蟩q这一节,直接q入下一节?/p>

CSS是Cascading Style Sheets(层叠样式?的羃写。是一U对web文d样式的简单机Ӟ属于表现层的布局语言?/p>

1.基本语法规范

分析一个典型CSS的语句:

{COLOR:#FF0000;BACKGROUND:#FFFFFF}

  • 其中"p"我们UCؓ"选择?(selectors)Q指明我们要l?p"定义样式Q?/li>
  • 样式声明写在一对大括号"{}"中;
  • COLOR和BACKGROUNDUCؓ"属?(property)Q不同属性之间用分号";"分隔Q?/li>
  • "#FF0000"?#FFFFFF"是属性的?value)?/li>

2.颜色?/h3>

颜色值可以用RGB值写Q例如:color : rgb(255,0,0)Q也可以用十六进制写Q就象上面例?span class="code">color:#FF0000。如果十六进制值是成对重复的可以简写,效果一栗例?#FF0000可以写成#F00。但如果不重复就不可以简写,例如#FC1A1B必须写满六位?/p>

3.定义字体

web标准推荐如下字体定义ҎQ?/p>

body { font-family : "Lucida Grande", Verdana, Lucida, Arial, Helvetica, 宋体,sans-serif; }

  • 字体按照所列出的顺序选用。如果用L计算机含有Lucida Grande字体Q文档将被指定ؓLucida Grande。没有的话,p指定为Verdana字体Q如果也没有VerdanaQ就指定为Lucida字体Q依此类推,Q?/li>
  • Lucida Grande字体适合Mac OS XQ?/li>
  • Verdana字体适合所有的WindowspȝQ?/li>
  • Lucida适合UNIX用户
  • "宋体"适合中文体用?
  • 如果所列出的字体都不能用,则默认的sans-serif字体能保证调?

4.选择?/h3>

当几个元素样式属性一hQ可以共同调用一个声明,元素之间用逗号分隔Q:

p, td, li { font-size : 12px ; }

5.z选择?/h3>

可以使用z选择器给一个元素里的子元素定义样式Q例如这P

li strong { font-style : italic; font-weight : normalQ?/span>}

是lli下面的子元素strong定义一个斜体不加粗的样式?/p>

6.id选择?/h3>

用CSS布局主要用层"div"来实玎ͼ而div的样式通过"id选择?来定义。例如我们首先定义一个层

<div id="menubar"></div>

然后在样式表里这样定义:

#menubar {MARGIN: 0px;BACKGROUND: #FEFEFE;COLOR: #666;}

其中"menubar"是你自己定义的id名称。注意在前面?#"受?/p>

id选择器也同样支持zQ例如:

#menubar p { text-align : right; margin-top : 10px; }

q个Ҏ主要用来定义层和那些比较复杂Q有多个z的元素?/p>

6.cd选择?/h3>

在CSS里用一个点开头表C类别选择器定义,例如Q?/p>

.14px {color : #f60 ;font-size:14px ;}

在页面中Q用class="cd?的方法调用:

<span class="14px">14px大小的字?lt;/span>

q个Ҏ比较单灵z,可以随时Ҏ面需要新建和删除?/p>

7.定义链接的样?/h3>

CSS中用四个伪类来定义链接的样式Q分别是Qa:link、a:visited、a:hover和a : activeQ例如:

a:link{font-weight : bold ;text-decoration : none ;color : #c00 ;}
a:visited 
{font-weight : bold ;text-decoration : none ;color : #c30 ;}
a:hover 
{font-weight : bold ;text-decoration : underline ;color : #f60 ;}
a:active 
{font-weight : bold ;text-decoration : none ;color : #90 ;}

以上语句分别定义?链接、已讉Kq的链接、鼠标停在上Ҏ、点下鼠标时"的样式。注意,必须按以上顺序写Q否则显C可能和你预想的不一栗记住它们的序是“LVHA”?/p>

呵呵Q看了这么多Q有点头晕吧Q实际上CSS的语法规范还有很多,q里列的只是一些常用的Q毕竟我们是循序渐进Q不可能一口吃成胖?)



Alex 2006-06-05 09:53 发表评论
]]>整理Qweb打印http://www.aygfsteel.com/alex/archive/2006/05/26/48424.htmlAlexAlexFri, 26 May 2006 15:08:00 GMThttp://www.aygfsteel.com/alex/archive/2006/05/26/48424.htmlhttp://www.aygfsteel.com/alex/comments/48424.htmlhttp://www.aygfsteel.com/alex/archive/2006/05/26/48424.html#Feedback0http://www.aygfsteel.com/alex/comments/commentRss/48424.htmlhttp://www.aygfsteel.com/alex/services/trackbacks/48424.htmlfunction SaveD...  阅读全文

Alex 2006-05-26 23:08 发表评论
]]>
վ֩ģ壺 ɿ| | ԣ| | | ϼ| | | | | | | | ɾ| ף| | | ʵ| ̰| | ƶ| ʡ| | | | | ¡| | | ǭ| ڳ| | ٳ| ף| | | | | ˮ| ˮ| |