不區(qū)分KEY大小寫的MAP
摘要: 發(fā)現(xiàn)快1年沒寫文章了,有時(shí)候我們會(huì)需要一個(gè)不區(qū)分KEY大小寫的MAP,當(dāng)然僅僅是Mapposted @ 2010-08-24 17:53 feng 閱讀(8197) | 評(píng)論 (2) | 編輯 收藏
飄逸~~~~~life
2010年8月24日 #
posted @ 2010-08-24 17:53 feng 閱讀(8197) | 評(píng)論 (2) | 編輯 收藏
2009年10月30日 #
posted @ 2009-10-30 17:24 feng 閱讀(2147) | 評(píng)論 (4) | 編輯 收藏
2009年8月10日 #
posted @ 2009-08-10 14:37 feng 閱讀(1791) | 評(píng)論 (6) | 編輯 收藏
2009年6月26日 #
posted @ 2009-06-26 16:32 feng 閱讀(2688) | 評(píng)論 (8) | 編輯 收藏
2009年4月9日 #
posted @ 2009-04-09 11:09 feng 閱讀(1835) | 評(píng)論 (0) | 編輯 收藏
2009年3月4日 #
posted @ 2009-03-04 16:11 feng 閱讀(3268) | 評(píng)論 (0) | 編輯 收藏
2009年2月26日 #
posted @ 2009-02-26 17:17 feng 閱讀(1660) | 評(píng)論 (0) | 編輯 收藏
2008年9月18日 #
posted @ 2008-09-18 10:11 feng 閱讀(1460) | 評(píng)論 (1) | 編輯 收藏
2008年8月29日 #
posted @ 2008-08-29 11:18 feng 閱讀(2643) | 評(píng)論 (8) | 編輯 收藏
2008年8月14日 #
最近在開發(fā)一個(gè)接口的過程中需要接收HTTP的POST請(qǐng)求里面正文的內(nèi)容,里面的數(shù)據(jù)是XML格式的字符串,同時(shí)在接收處理完成業(yè)務(wù)后需要向?qū)Ψ桨l(fā)送HTTP的POST請(qǐng)求,使用到了 HttpURLConnection類,來發(fā)送出一個(gè)POST請(qǐng)求,同時(shí)將我處理的結(jié)果寫入正文當(dāng)中,原先自己測(cè)試的時(shí)候也一直沒有成功發(fā)送出數(shù)據(jù),我自己使用了
HttpServletRequest中g(shù)etInputStream方法來接收數(shù)據(jù),沒有收到任何數(shù)據(jù)。
后來發(fā)現(xiàn)只要在使用HttpURLConnection的時(shí)候
httpURLConnection.setDoInput(true);
httpURLConnection.setDoOutput(true);
httpURLConnection.setConnectTimeout(10000);
httpURLConnection.setRequestProperty("content-type", "text/html;charset=utf-8");
httpURLConnection.setRequestMethod("POST");
其中setRequestProperty("content-type", "text/html;charset=utf-8"); 這個(gè)屬性一點(diǎn)要設(shè)置,否則接收不到數(shù)據(jù)
在接收的時(shí)候也發(fā)現(xiàn)個(gè)奇怪的問題,接收不到任何的數(shù)據(jù),后來發(fā)現(xiàn)我在
getInputStream方法前面使用了 getParameter方法,導(dǎo)致了getInputStream方法取不到任何數(shù)據(jù),只要
把他們換下位置就可以了
posted @ 2008-08-14 10:17 feng 閱讀(7075) | 評(píng)論 (5) | 編輯 收藏