久久综合九色综合欧美狠狠,欧美日韩一区不卡,午夜在线网站http://www.aygfsteel.com/rox/靜風(fēng)流云之揮意舒達(dá)—?dú)堎vzh-cnTue, 17 Jun 2025 20:59:54 GMTTue, 17 Jun 2025 20:59:54 GMT60在 Windows 上離線(xiàn)安裝 Chromehttp://www.aygfsteel.com/rox/archive/2016/05/21/430606.htmlroxroxSat, 21 May 2016 12:52:00 GMThttp://www.aygfsteel.com/rox/archive/2016/05/21/430606.htmlhttp://www.aygfsteel.com/rox/comments/430606.htmlhttp://www.aygfsteel.com/rox/archive/2016/05/21/430606.html#Feedback0http://www.aygfsteel.com/rox/comments/commentRss/430606.htmlhttp://www.aygfsteel.com/rox/services/trackbacks/430606.html在 Windows 上離線(xiàn)安裝 Chrome
https://support.google.com/chrome/answer/126299?hl=zh-Hans
這里鏈接默認(rèn)是32位的。
針對(duì)所有用戶(hù)安裝版64位完整鏈接為:
https://www.google.com/chrome/browser/desktop/index.html?system=true&standalone=1&platform=win64

Chorome快捷方式+SwitchyOmega

/Files/rox/chrome.7z


rox 2016-05-21 20:52 發(fā)表評(píng)論
]]>
一次面試的感想http://www.aygfsteel.com/rox/archive/2013/07/28/402053.htmlroxroxSun, 28 Jul 2013 03:53:00 GMThttp://www.aygfsteel.com/rox/archive/2013/07/28/402053.htmlhttp://www.aygfsteel.com/rox/comments/402053.htmlhttp://www.aygfsteel.com/rox/archive/2013/07/28/402053.html#Feedback0http://www.aygfsteel.com/rox/comments/commentRss/402053.htmlhttp://www.aygfsteel.com/rox/services/trackbacks/402053.html參加了國(guó)內(nèi)某知名快遞公司的面試,一面就放棄了
自己公司的一個(gè)HR經(jīng)理也曾經(jīng)教過(guò)要換位思考,現(xiàn)在簡(jiǎn)單的介紹一下面試過(guò)程中的一些感想。
1. HR打電話(huà)的時(shí)候,問(wèn)周六有沒(méi)有空?
問(wèn)題:雖然是專(zhuān)場(chǎng),但這是很多HR應(yīng)該規(guī)避的,應(yīng)該盡量說(shuō)明這是公司的安排,這種周六加班不是企業(yè)文化。
建議:曾經(jīng)遇到過(guò)的幾個(gè)HR都非常注意這一點(diǎn),特別說(shuō)明晚上和周末一般都不加班,雖然說(shuō)HR多半都是騙子,呵呵!
2. 回答都有空,便安排在早晨的第二個(gè)時(shí)間段
問(wèn)題:實(shí)際上安排了將近50人在早晨面試,可想而知,是面不完的。
      現(xiàn)場(chǎng)有點(diǎn)貌似華為面試,只不過(guò)不是在食堂:D
      11點(diǎn)左右HR一面,20分鐘,到了12點(diǎn)鐘,組織方開(kāi)始發(fā)餐票,到隔壁快餐店用餐。
      沒(méi)拿餐票,直接回家了。
建議:組織安排上,還算OK,但稍微比較有經(jīng)驗(yàn)和有能力的HR,應(yīng)該不會(huì)做這樣的安排。
      即使是新項(xiàng)目啟動(dòng),采取這樣方式海招,風(fēng)險(xiǎn)比較大,應(yīng)該是一個(gè)相對(duì)長(zhǎng)期的過(guò)程,可以把招聘過(guò)程安排的相對(duì)寬松點(diǎn)。
      在公司,自己也做技術(shù)面試,一般都會(huì)面半個(gè)小時(shí)到一個(gè)小時(shí)左右,連續(xù)面了兩個(gè)以上,精力和質(zhì)量就會(huì)下降的很厲害。
3. 一面HR的內(nèi)容,2分鐘介紹自己,同時(shí)看表,增加面試著的壓力。再問(wèn)了工作和生活上的問(wèn)題,還有技術(shù)問(wèn)題!
問(wèn)題:技術(shù)問(wèn)題,比較有意思。
      HR問(wèn),最近一年,業(yè)界都有那些新技術(shù),回答了Android和iPhone,猜他是想問(wèn)云計(jì)算(面試前調(diào)研過(guò),該公司有一直想進(jìn)電商行業(yè))。
      然后,HR再問(wèn)Java方面有啥新技術(shù),特意回答沒(méi)啥新的啊。這個(gè)后來(lái)被自己朋友批,不知道反問(wèn)他么!
      這時(shí),HR就做出了一個(gè)重大的決定,準(zhǔn)備開(kāi)始對(duì)我的職位進(jìn)行降級(jí)。問(wèn)有沒(méi)有意向,直接否掉。
      然后就說(shuō),各個(gè)公司的職位要求不一樣,該公司要求更高點(diǎn),就結(jié)束談話(huà),等待下一輪面試。
      40分鐘后,開(kāi)始發(fā)餐票。自己什么都沒(méi)說(shuō)就走了,這個(gè)其實(shí)也是特意做的,后面會(huì)有解釋。
建議:面試20多分鐘,都是HR對(duì)面試者進(jìn)行提問(wèn)和定位,不留給對(duì)方了解相關(guān)項(xiàng)目的機(jī)會(huì),這個(gè)很少見(jiàn)。
      另外,很多初級(jí)HR只對(duì)項(xiàng)目里面說(shuō)需要技術(shù)單詞比較敏感,往往會(huì)在面試的時(shí)候,就急于問(wèn),好進(jìn)行準(zhǔn)確定位。
      但又怕問(wèn)了以后會(huì)讓面試者對(duì)后面的技術(shù)面試有所準(zhǔn)備,技巧啊,技巧?。?/div>
另外:解釋一下自己沒(méi)領(lǐng)餐票直接走人,其實(shí)想看一下組織方會(huì)有哪些動(dòng)作。
      1. 發(fā)餐票的HR妹妹,啥也沒(méi)問(wèn),直接放走。一個(gè)已經(jīng)等了將近三個(gè)小時(shí)面試者,卻不愿意再多等一個(gè)小時(shí),沒(méi)有任何疑問(wèn)。這種情況發(fā)生在自己公司,會(huì)被HR經(jīng)理罵的。呵呵!
      2. 負(fù)責(zé)一面的HR,大約在一個(gè)小時(shí)后的確給電話(huà)了,你在哪?自己說(shuō)回家了,然后HR就說(shuō)那下次有機(jī)會(huì)再聯(lián)系吧,就掛了。看來(lái)他真的很忙。呵呵!
也參與過(guò)自己公司的很多面試,接觸HR比較多,從HR經(jīng)理那里也學(xué)到了不少東西,包括壓力測(cè)試(其實(shí),面試者也可以多給HR一些壓力測(cè)試)。
感覺(jué)這個(gè)非常有意思,比和搞技術(shù)的打交道有意思。
把自己面試時(shí)的一些想法和技巧列出來(lái)。
可能還是太片面,而且?guī)е慵夹g(shù)的那種“壞味道”。
只是希望能為大家提供一點(diǎn)點(diǎn)參考。


rox 2013-07-28 11:53 發(fā)表評(píng)論
]]>最近的雜想http://www.aygfsteel.com/rox/archive/2013/07/21/401812.htmlroxroxSun, 21 Jul 2013 15:19:00 GMThttp://www.aygfsteel.com/rox/archive/2013/07/21/401812.htmlhttp://www.aygfsteel.com/rox/comments/401812.htmlhttp://www.aygfsteel.com/rox/archive/2013/07/21/401812.html#Feedback0http://www.aygfsteel.com/rox/comments/commentRss/401812.htmlhttp://www.aygfsteel.com/rox/services/trackbacks/401812.html這個(gè)似乎有道理,但完全不考慮,真正實(shí)際環(huán)境,是涉及到三方交易結(jié)算的的東西啊,真替他捏把汗。

現(xiàn)在的項(xiàng)目,一堆Oracle、騰訊、華為、證券摸爬滾打出來(lái)的技術(shù)精英,還包括一個(gè)純servlet+jdbc開(kāi)源項(xiàng)目的作者湊一堆。
不懂Tomcat下為什么要配置filter轉(zhuǎn)碼,把這個(gè)和虛擬機(jī)編碼機(jī)制混為一談,最后感慨一句weblogic就沒(méi)這問(wèn)題。
也有不懂啥是樂(lè)觀(guān)鎖的。
面試的時(shí)候,對(duì)集合類(lèi)型及操作考的頭頭是道,但項(xiàng)目里,一個(gè)都沒(méi)用到。
項(xiàng)目中遇到問(wèn)題,往往就是解決、解決+解決,不究其原理。
感覺(jué)自己像在做硬件拼裝的富士康。

牢騷兩句。

rox 2013-07-21 23:19 發(fā)表評(píng)論
]]>
wubi使用amd64.tar.xz安裝64位ubuntuhttp://www.aygfsteel.com/rox/archive/2012/07/12/382873.htmlroxroxThu, 12 Jul 2012 05:26:00 GMThttp://www.aygfsteel.com/rox/archive/2012/07/12/382873.htmlhttp://www.aygfsteel.com/rox/comments/382873.htmlhttp://www.aygfsteel.com/rox/archive/2012/07/12/382873.html#Feedback4http://www.aygfsteel.com/rox/comments/commentRss/382873.htmlhttp://www.aygfsteel.com/rox/services/trackbacks/382873.html拷貝wubi.exe和下載好的ubuntu-12.04-wubi-amd64.tar.xz都拷貝到C盤(pán)根目錄下,然后執(zhí)行下面命令即可。

1 wubi.exe --dimagepath=c:\ubuntu-12.04-wubi-amd64.tar.xz

資源:
What is ubuntu-11.10-wubi-amd64.tar.xz ? 

wubi安裝Ubuntu11.**正確方法及無(wú)限等待下載amd64.tar.xz解決方法



rox 2012-07-12 13:26 發(fā)表評(píng)論
]]>
Grails結(jié)合Uploadify上傳文件的簡(jiǎn)單代碼http://www.aygfsteel.com/rox/archive/2010/12/06/339900.htmlroxroxMon, 06 Dec 2010 07:38:00 GMThttp://www.aygfsteel.com/rox/archive/2010/12/06/339900.htmlhttp://www.aygfsteel.com/rox/comments/339900.htmlhttp://www.aygfsteel.com/rox/archive/2010/12/06/339900.html#Feedback2http://www.aygfsteel.com/rox/comments/commentRss/339900.htmlhttp://www.aygfsteel.com/rox/services/trackbacks/339900.html參考了這篇the script is not working for any mvc frameworkuri的回復(fù),結(jié)合當(dāng)前Uploadifyv2.1.4版,netbean 6.9.1下編寫(xiě)調(diào)試。

        新建grails工程,名為test,并把Uploadify-v2.1.4.zip解壓到web-app\uploadify目錄下。

        新建grails控制器PictureController,代碼如下

package com.test

 

class PictureController {

 

    def index = { redirect(action: "upload") }

 

    def upload = { }

 

    def savePicture = {

       def files = request.getFileMap();

       def path = "c:/test/" + files.get("Filedata").getOriginalFilename();

       files.get("Filedata").transferTo( new File(path))

       render (view:'upload')

    }

}

        新建grails視圖upload.gsp,代碼如下,注意粗體部分的上下文路徑

<html>

  <head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>upload file sample</title>

    <link rel="stylesheet" href="/test/uploadify/uploadify.css" type="text/css" />

    <script type="text/javascript" src="/test/uploadify/jquery-1.4.2.min.js"></script>

    <script type="text/javascript" src="/test/uploadify/swfobject.js"></script>

    <script type="text/javascript" src="/test/uploadify/jquery.uploadify.v2.1.4.min.js"></script>

    <script type="text/javascript">

    $(document).ready(function() {

            $("#fileUpload").uploadify({

                'uploader': '/test/uploadify/uploadify.swf',

              'cancelImg': '/test/uploadify/cancel.png',

              'script': '/test/picture/savePicture',

              'folder': 'files',

              'multi': true,

              'buttonText': 'add',

              'displayData': 'speed',

              'simUploadLimit': 2

            });

    });

    </script>

  </head>

  <body>

    <hr width=100% size="1" color="" align="center">

        <h2>Multiple File Upload</h2>

        <p>checkScript, buttonText, simulataneous upload limit</p>

        <div id="fileUpload">You have a problem with your javascript</div>

        <a href="javascript:$('#fileUpload').uploadifyUpload()">Start Upload</a> |  <a href="javascript:$('#fileUpload').uploadifyClearQueue()">Clear Queue</a>

<p></p>

  </body>

</html>

        運(yùn)行工程,訪(fǎng)問(wèn)http://localhost:8080/test/picture/upload



rox 2010-12-06 15:38 發(fā)表評(píng)論
]]>
耶魯CAS代理認(rèn)證的代碼及簡(jiǎn)單ppthttp://www.aygfsteel.com/rox/archive/2010/04/14/CAS_Proxy_Authentication.htmlroxroxWed, 14 Apr 2010 09:41:00 GMThttp://www.aygfsteel.com/rox/archive/2010/04/14/CAS_Proxy_Authentication.htmlhttp://www.aygfsteel.com/rox/comments/318283.htmlhttp://www.aygfsteel.com/rox/archive/2010/04/14/CAS_Proxy_Authentication.html#Feedback2http://www.aygfsteel.com/rox/comments/commentRss/318283.htmlhttp://www.aygfsteel.com/rox/services/trackbacks/318283.html

公司安排研究耶魯CAS單點(diǎn)登錄的實(shí)現(xiàn),并研究了一下它的代理協(xié)議,看了N多文檔和代碼,才大概明白是怎么回事。
為了方便有興趣的朋友學(xué)習(xí),去掉了HTTPS的加密,源代碼、webapp包和配置文件都有。
本來(lái)打算針對(duì)這個(gè)寫(xiě)篇文章,不想寫(xiě)了。

  

另:

  • 針對(duì)cas-server-2.0.12和cas-client-2.0.11的
  • ppt中部分內(nèi)容是翻譯+自己理解的,中英文水平均有限,請(qǐng)諒解。

下載地址:



rox 2010-04-14 17:41 發(fā)表評(píng)論
]]>
JasperReports數(shù)據(jù)庫(kù)查詢(xún)父子報(bào)表模板http://www.aygfsteel.com/rox/archive/2010/02/26/314005.htmlroxroxFri, 26 Feb 2010 08:12:00 GMThttp://www.aygfsteel.com/rox/archive/2010/02/26/314005.htmlhttp://www.aygfsteel.com/rox/comments/314005.htmlhttp://www.aygfsteel.com/rox/archive/2010/02/26/314005.html#Feedback0http://www.aygfsteel.com/rox/comments/commentRss/314005.htmlhttp://www.aygfsteel.com/rox/services/trackbacks/314005.html/* default css */table {font-size: 1em;line-height: inherit;border-collapse: collapse;}tr {text-align: left;}div, address, ol, ul, li, option, select {margin-top: 0px;margin-bottom: 0px;}p {margin: 0px;}pre {font-family: Courier New;white-space: pre-wrap;margin:0;}body {margin: 6px;padding: 0px;font-family: Verdana, sans-serif;font-size: 10pt;background-color: #ffffff;color: #000;}img {-moz-force-broken-image-icon: 1;}@media screen {html.pageview {background-color: #f3f3f3 !important;overflow-x: hidden;overflow-y: scroll;}body {min-height: 1100px;counter-reset: __goog_page__;}* html body {height: 1100px;}/* Prevent repaint errors when scrolling in Safari. This "Star-7" css hacktargets Safari 3.1, but not WebKit nightlies and presumably Safari 4.That's OK because this bug is fixed in WebKit nightlies/Safari 4 :-). */html*#wys_frame::before {content: '\A0';position: fixed;overflow: hidden;width: 0;height: 0;top: 0;left: 0;}.pageview body {border-top: 1px solid #ccc;border-left: 1px solid #ccc;border-right: 2px solid #bbb;border-bottom: 2px solid #bbb;width: 648px !important;margin: 15px auto 25px;padding: 40px 50px;}/* IE6 */* html {overflow-y: scroll;}* html.pageview body {overflow-x: auto;}.writely-callout-data {display: inline-block;width: 0;height: 0;overflow: hidden;}.writely-footnote-marker {background-image: url('images/footnote_doc_icon.gif');background-color: transparent;background-repeat: no-repeat;width: 7px;overflow: hidden;height: 16px;vertical-align: top;-moz-user-select: none;}.editor .writely-footnote-marker {cursor: move;}.writely-footnote-marker-highlight {background-position: -15px 0;-moz-user-select: text;}.writely-footnote-hide-selection ::-moz-selection, .writely-footnote-hide-selection::-moz-selection {background: transparent;}.writely-footnote-hide-selection ::selection, .writely-footnote-hide-selection::selection {background: transparent;}.writely-footnote-hide-selection {cursor: move;}/* Comments */.writely-comment-yellow {background-color: #ffffd7;}.writely-comment-orange {background-color: #ffe3c0;}.writely-comment-pink {background-color: #ffd7ff;}.writely-comment-green {background-color: #d7ffd7;}.writely-comment-blue {background-color: #d7ffff;}.writely-comment-purple {background-color: #eed7ff;}.br_fix span+br:not(:-moz-last-node) {position:relative;left: -1ex}#cb-p-tgt {font-size: 8pt;padding: .4em;background-color: #ddd;color: #333;}#cb-p-tgt-can {text-decoration: underline;color: #36c;font-weight: bold;margin-left: 2em;}#cb-p-tgt .spin {width: 16px;height: 16px;background: url(//ssl.gstatic.com/docs/clipboard/spin_16o.gif) no-repeat;}}h6 { font-size: 8pt }h5 { font-size: 8pt }h4 { font-size: 10pt }h3 { font-size: 12pt }h2 { font-size: 14pt }h1 { font-size: 18pt }blockquote {padding: 10px; border: 1px #DDD dashed }.webkit-indent-blockquote { border: none; }a img {border: 0}.pb {border-width: 0;page-break-after: always;/* We don't want this to be resizeable, so enforce a width and heightusing !important */height: 1px !important;width: 100% !important;}.editor .pb {border-top: 1px dashed #C0C0C0;border-bottom: 1px dashed #C0C0C0;}div.google_header, div.google_footer {position: relative;margin-top: 1em;margin-bottom: 1em;}/* Table of contents */.editor div.writely-toc {background-color: #f3f3f3;border: 1px solid #ccc;}.writely-toc > ol {padding-left: 3em;font-weight: bold;}ol.writely-toc-subheading {padding-left: 1em;font-weight: normal;}/* IE6 only */* html writely-toc ol {list-style-position: inside;}.writely-toc-none {list-style-type: none;}.writely-toc-decimal {list-style-type: decimal;}.writely-toc-upper-alpha {list-style-type: upper-alpha;}.writely-toc-lower-alpha {list-style-type: lower-alpha;}.writely-toc-upper-roman {list-style-type: upper-roman;}.writely-toc-lower-roman {list-style-type: lower-roman;}.writely-toc-disc {list-style-type: disc;}/* Ordered lists converted to numbered lists can preserve ordered types, andvice versa. This is confusing, so disallow it */ul[type="i"], ul[type="I"], ul[type="1"], ul[type="a"], ul[type="A"] {list-style-type: disc;}ol[type="disc"], ol[type="circle"], ol[type="square"] {list-style-type: decimal;}/* end default css *//* custom css *//* end custom css *//* ui edited css */body {font-family: Verdana;font-size: 14.0pt;line-height: normal;background-color: #ffffff;}/* end ui edited css *//* editor CSS */.editor a:visited {color: #551A8B}.editor table.zeroBorder {border: 1px dotted gray}.editor table.zeroBorder td {border: 1px dotted gray}.editor table.zeroBorder th {border: 1px dotted gray}.editor div.google_header, .editor div.google_footer {border: 2px #DDDDDD dashed;position: static;width: 100%;min-height: 2em;}.editor .misspell {background-color: yellow}.editor .writely-comment {font-size: 9pt;line-height: 1.4;padding: 1px;border: 1px dashed #C0C0C0}/* end editor CSS */
JasperReports數(shù)據(jù)庫(kù)查詢(xún)父子報(bào)表模板



  • 安裝并打開(kāi)iReport,并新建一個(gè)報(bào)表文件(見(jiàn)圖-1)
[圖-1]

  • 選擇在“c:\test”目錄下建立一個(gè)find文件(見(jiàn)圖-2)
[圖-2]

  • 新建一個(gè)datasource,選擇jdbc連接方式,命名為find。使用HSQLDB(File)方式,url為jdbc:hsqldb:c:/test/find.hsql,用戶(hù)名為sa,密碼為空,測(cè)試一下,成功了,保存即可(見(jiàn)圖-3、圖-4、圖-5
[圖-3]

[圖-4]

[圖-5]

  • 設(shè)置報(bào)表查詢(xún)語(yǔ)句、字段后,組和結(jié)束頁(yè)面基本跳過(guò)(見(jiàn)圖-6、圖-7、圖-8、圖-9
[圖-6]

[圖-7]


[圖-8]


[圖-9]

  • 其實(shí)做到這里,就可以自己制作根據(jù)數(shù)據(jù)庫(kù)查詢(xún)報(bào)表了,要畫(huà)圖設(shè)置一些參數(shù),說(shuō)起來(lái)麻煩,就干脆打開(kāi)樣例模板來(lái)看看結(jié)果吧。
這里需要說(shuō)明的是report1.jrxml是主報(bào)表、report1_subreport2.jrxml是子報(bào)表,主報(bào)表查出的每條記錄的結(jié)果CLASSNAME作為子報(bào)表的查詢(xún)條件參數(shù)傳遞過(guò)去(見(jiàn)圖-10、圖-11、圖-12、圖-13
[圖-10]

[圖-11]

[圖-12]

[圖-13]


參考資料:
  • 樣例模板和數(shù)據(jù)庫(kù)
http://docs.google.com/leaf?id=0B8vmIM2WmTA2OWE5ZGY0OTktMTkyZC00ZTljLTg1YjMtODA5ZWQ3NjA0MjMz&hl=zh_CN

  • Creating JasperReport subreports
http://publib.boulder.ibm.com/infocenter/rbdhelp/v7r5m0/index.jsp?topic=/com.ibm.egl.pg.doc/topics/pegl_rep_subreport_create_tsk.html

  • 利用復(fù)合的javabean構(gòu)造基于jasperreports的子報(bào)表

本文地址


rox 2010-02-26 16:12 發(fā)表評(píng)論
]]>
java開(kāi)發(fā)的亂碼問(wèn)題[轉(zhuǎn)貼]http://www.aygfsteel.com/rox/archive/2010/01/05/308230.htmlroxroxTue, 05 Jan 2010 00:43:00 GMThttp://www.aygfsteel.com/rox/archive/2010/01/05/308230.htmlhttp://www.aygfsteel.com/rox/comments/308230.htmlhttp://www.aygfsteel.com/rox/archive/2010/01/05/308230.html#Feedback0http://www.aygfsteel.com/rox/comments/commentRss/308230.htmlhttp://www.aygfsteel.com/rox/services/trackbacks/308230.html原帖地址:java開(kāi)發(fā)的亂碼問(wèn)題

 

第一,存文件必須以一種編碼存;讀文件也必須以一種編碼讀,如不特別設(shè)置,去系統(tǒng)默認(rèn)的編碼,中文windows為GBK編碼。

從.java->.class過(guò)程是,先編寫(xiě).java文件并按莫種編碼方式保存,然后用javac方法編譯此文件,注意如.java沒(méi)按系統(tǒng)默認(rèn)編碼保存則要帶encoding參數(shù)指明實(shí)際編碼,否則出錯(cuò),生成的.class文件存為系統(tǒng)默認(rèn)編碼。

從.jsp->.java->.class,先存為某種編碼的.jsp文件,然后tomcat根據(jù)pageEncoding讀取并轉(zhuǎn)化為servlet存為系統(tǒng)默認(rèn)編碼,然后同上面.java->.class過(guò)程。

第二,IDE的encoding為對(duì)系統(tǒng)下文件打開(kāi)的解碼方式或保存的編碼方式。特例:如果.jsp文件有<%@ page language="java" pageEncoding="UTF-8"%>,則eclipse會(huì)自動(dòng)存為UTF-8方式,不管eclipse的encoding是什么,這也是eclipse的聰明之處。

第三,
pageEncoding="UTF-8"表示此文件的編碼方式,必須與此文件存儲(chǔ)方式一致(所以eclipse會(huì)首選根據(jù)它來(lái)存文件),tomcat根據(jù)這個(gè)來(lái)讀此.jsp文件并編譯為servlet。
contentType="text/html;charset=UTF-8"表示當(dāng)瀏覽器得到此文件時(shí)以什么方式解碼。例如:
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=iso8859-1"%>
<html>
 <head>
  <title>test</title>
 </head>
 <body>
  我是個(gè)好人
 </body>
</html>
會(huì)產(chǎn)生亂碼,因?yàn)榇鏋閁TF-8的文件被解碼為iso8859-1,這樣 如有中文肯定出亂碼。

至此,頁(yè)面應(yīng)為:
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<html>
 <head>
  <title>中文問(wèn)題</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 </head>
</html>

第四,
request.setCharacterEncoding("UTF-8")是把提交內(nèi)容的字符集設(shè)為UTF-8
response.setCharacterEncoding("UTF-8")可以把頁(yè)面中的<%@ page contentType="text/html;charset=iso8859-1"%>換為charset=UTF-8,是給告訴瀏覽器我這個(gè)文件的編碼方式。

第五,表單提交:無(wú)論何種表單提交都可以在后臺(tái)的java文件中通過(guò)String des = new String(s.getBytes("iso8859-1"),"UTF-8");來(lái)轉(zhuǎn)換成你想要的UTF-8編碼方式。但如果每處都加詞句太麻煩,故分post和get兩種方式區(qū)分提交(tomcat5以后分開(kāi)處理,之前處理方式一樣,即都可以用request.setCharacterEncoding("UTF-8")方法處理,不過(guò)tomcat5以后get提交方法用此語(yǔ)句無(wú)效)。
1,post提交的數(shù)據(jù):
程序加上org.springframework.web.filter.CharacterEncodingFilter過(guò)濾器.
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>

<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*.html</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>

因?yàn)橐?guī)范要求瀏覽器提交數(shù)據(jù)都要用utf8編碼,所以這里設(shè)置編碼方式為UTF8.

特別注意:
a,這個(gè)過(guò)濾器只是簡(jiǎn)單的調(diào)用:request.setCharacterEncoding(this.encoding);
在這個(gè)語(yǔ)句之前不能調(diào)用任何的request.getParameter()方法,否則會(huì)設(shè)置tomcat的缺省字符集為"ISO-8859-1",并且使setCharacterEncoding的調(diào)用失效.所以在這個(gè)過(guò)濾器之前的過(guò)濾器中不能有對(duì)getParameter這類(lèi)方法的調(diào)用,比較安全的做法就是把這個(gè)過(guò)濾器盡量靠前放.
b,在server.xml中不能加上<Valve className="org.apache.catalina.valves.RequestDumperValve"/>
這個(gè)value也設(shè)置tomcat的缺省字符集為"ISO-8859-1",使setCharacterEncoding的調(diào)用失效.可能其他的value也有這個(gè)問(wèn)題,我沒(méi)有測(cè)試過(guò).
如果要觀(guān)察http請(qǐng)求參數(shù),可以考慮用過(guò)濾器或者其他工具,例如ethereal(http://www.ethereal.com/)

2,get提交的數(shù)據(jù):
兩種情況:
a,如果從地址欄直接輸入漢字,則一般編碼為"GBK",需要用
new String(request.getParameter("something").getBytes("ISO-8859-1"),"GBK")
取出
b,如果是頁(yè)面超連接連接中帶的漢字,則編碼根據(jù)頁(yè)面編碼的不同而不同,如果頁(yè)面的
content="text/html; charset=utf-8",則在tomcat/conf/server.xml中的配置文件中:
<!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
<Connector port="8080"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000" useBodyEncodingForURI="true"
disableUploadTimeout="true" />

加上:useBodyEncodingForURI="true"即可正常使用getParameter取出正確內(nèi)容.
如果content="text/html; charset=GBK",需用
new String(request.getParameter("something").getBytes("ISO-8859-1"),"GBK")
取出,其他情況類(lèi)似.

總結(jié):
1,所有頁(yè)面使用utf8編碼,
2,服務(wù)器加上過(guò)濾器,
3,server.xml中不要使用
<Valve className="org.apache.catalina.valves.RequestDumperValve"/>
4,server.xml文件加上useBodyEncodingForURI="true"
這樣應(yīng)該可以搞定大多數(shù)前臺(tái)的中文問(wèn)題.至于地址欄輸入中文,不支持也罷,一般的程序很少要求
從這里輸入.

第六,連接數(shù)據(jù)庫(kù)

1、mysql配置文件:
修改mysql在windowsmy.ini里default-character-set=utf-8

2、mysql里數(shù)據(jù)庫(kù)和表也都設(shè)為utf8_unicode_ci

3、數(shù)據(jù)庫(kù)連結(jié):jdbc:mysql://localhost/mydb?useUnicode=true&characterEncoding=utf-8
注意,關(guān)鍵就在于此:此句中間是'&'不是'&amp;'這是因?yàn)閿?shù)據(jù)庫(kù)連結(jié)時(shí),在.jsp和.java文件中應(yīng)該用&號(hào),而XML文件中需要用&amp



rox 2010-01-05 08:43 發(fā)表評(píng)論
]]>
Runtime.getRuntime().exec學(xué)習(xí)記錄[轉(zhuǎn)貼]http://www.aygfsteel.com/rox/archive/2009/12/29/307660.htmlroxroxTue, 29 Dec 2009 09:10:00 GMThttp://www.aygfsteel.com/rox/archive/2009/12/29/307660.htmlhttp://www.aygfsteel.com/rox/comments/307660.htmlhttp://www.aygfsteel.com/rox/archive/2009/12/29/307660.html#Feedback0http://www.aygfsteel.com/rox/comments/commentRss/307660.htmlhttp://www.aygfsteel.com/rox/services/trackbacks/307660.html原帖:http://chenyaqiong81081.blog.163.com/blog/static/44622594200791235256255/

一、Runtime.getRuntime().exec()執(zhí)行命令情況:
       Runtime.getRuntime().exec("cmd /c your command")//2000
       Runtime.getRuntime().exec("command /c your command")//98
       Runtime.getRuntime().exec("sh/ your command")//linux

二、執(zhí)行.sh文件的情況:
      1、把命令寫(xiě)成a.sh ;執(zhí)行命令的時(shí)候
           Process child = Runtime.getRuntime().exec("bash a.sh,null,new File("http://usr/local/mysql/bin/"));
           child.waitFor();
           ........
       2、Process child = Runtime.getRuntime().

                                          exec(new String[] {"/bin/sh","-c","mysqldump -u root -p7788919 axtic_cg" },

                                                   null,
                                                   new File("/usr/local/mysql/bin/"));
            child.waitFor();

            注:waitFor()等待操作完成



rox 2009-12-29 17:10 發(fā)表評(píng)論
]]>
Java多層目錄打包和解壓代碼(apache commons compress, io, lang)http://www.aygfsteel.com/rox/archive/2009/11/12/302151.htmlroxroxThu, 12 Nov 2009 14:53:00 GMThttp://www.aygfsteel.com/rox/archive/2009/11/12/302151.htmlhttp://www.aygfsteel.com/rox/comments/302151.htmlhttp://www.aygfsteel.com/rox/archive/2009/11/12/302151.html#Feedback1http://www.aygfsteel.com/rox/comments/commentRss/302151.htmlhttp://www.aygfsteel.com/rox/services/trackbacks/302151.html閱讀全文

rox 2009-11-12 22:53 發(fā)表評(píng)論
]]>
主站蜘蛛池模板: 中江县| 黄梅县| 洪湖市| 抚宁县| 诏安县| 云梦县| 正定县| 宁波市| 临西县| 多伦县| 佳木斯市| 山阴县| 定日县| 阿拉尔市| 杨浦区| 哈尔滨市| 友谊县| 馆陶县| 那坡县| 岳池县| 邵东县| 渑池县| 济南市| 保定市| 兴仁县| 灵川县| 石河子市| 吴忠市| 恩施市| 绥中县| 和田县| 安福县| 定安县| 黑河市| 廉江市| 花莲县| 锡林郭勒盟| 淳化县| 龙江县| 五台县| 盖州市|