javaÖеÄURLEncoderºÍURLDecoderÀà
[ת]http://www.java3z.com/cwbwebhome/article/article2/2414.html?id=1101
/*
ÍøÒ³ÖÐµÄ±íµ¥Ê¹ÓÃPOST·½·¨Ìύʱ£¬Êý¾ÝÄÚÈݵÄÀàÐÍÊÇ application/x-www-form-urlencoded£¬ÕâÖÖÀàÐͻ᣺
1.×Ö·û"a"-"z"£¬"A"-"Z"£¬"0"-"9"£¬"."£¬"-"£¬"*"£¬ºÍ"_" ¶¼²»»á±»±àÂë;
2.½«¿Õ¸ñת»»Îª¼ÓºÅ (+) ;
3.½«·ÇÎı¾ÄÚÈÝת»»³É"%xy"µÄÐÎʽ,xyÊÇÁ½Î»16½øÖƵÄÊýÖµ;
4.ÔÚÿ¸ö name=value ¶ÔÖ®¼ä·ÅÖà & ·ûºÅ¡£
*/
URLEncoderÀà°üº¬½«×Ö·û´®×ª»»Îªapplication/x-www-form-urlencoded MIME ¸ñʽµÄ¾²Ì¬·½·¨¡£
webÉè¼ÆÕßÃæÁÙµÄÖÚ¶àÄÑÌâÖ®Ò»±ãÊÇÔõÑù´¦Àí²»Í¬²Ù×÷ϵͳ¼äµÄ²îÒìÐÔ¡£ÕâЩ²îÒìÐÔÄÜÒýÆðURL·½ÃæµÄÎÊÌ⣺ÀýÈ磬һЩ²Ù×÷ϵͳÔÊÐíÎļþÃûÖк¬Óпոñ·û£¬ÓÐЩÓÖ²»ÔÊÐí¡£´ó¶àÊý²Ù×÷ϵͳ²»»áÈÏΪÎļþÃûÖк¬ÓзûºÅ“#”»áÓÐʲôÌØÊ⺬Ò壻µ«ÊÇÔÚÒ»¸öURLÖУ¬·ûºÅ“#”±íʾ¸ÃÎļþÃûÒѾ½áÊø£¬ºóÃæ»á½ô¸úÒ»¸öfragment£¨²¿·Ö£©±êʶ·û¡£ÆäËûµÄÌØÊâ×Ö·û£¬·Ç×ÖĸÊý×Ö×Ö·û¼¯£¬ËüÃÇÔÚURL»òÁíÒ»¸ö²Ù×÷ϵͳÉ϶¼ÓÐÆäÌØÊâµÄº¬Ò壬±íÊö×ÅÏàËƵÄÎÊÌ⡣ΪÁ˽â¾öÕâЩÎÊÌ⣬ÎÒÃÇÔÚURLÖÐʹÓõÄ×Ö·û¾Í±ØÐëÊÇÒ»¸öASCII×Ö·û¼¯µÄ¹Ì¶¨×Ö¼¯ÖеÄÔªËØ£¬¾ßÌåÈçÏ£º
1.´óд×ÖĸA-Z
2.Сд×Öĸa-z
3.Êý×Ö 0-9
4.±êµã·û - _ . ! ~ * ' (ºÍ ,)
ÖîÈç×Ö·û: / & ? @ # ; $ + = ºÍ %Ò²¿ÉÒÔ±»Ê¹Ó㬵«ÊÇËüÃǸ÷ÓÐÆäÌØÊâµÄÓÃ;£¬Èç¹ûÒ»¸öÎļþÃû°üÀ¨ÁËÕâЩ×Ö·û£¨ / & ? @ # ; $ + = %£©£¬ÕâЩ×Ö·ûºÍËùÓÐÆäËû×Ö·û¾ÍÓ¦¸Ã±»±àÂë¡£
±àÂë¹ý³Ì·Ç³£¼òµ¥£¬ÈκÎ×Ö·ûÖ»Òª²»ÊÇASCIIÂëÊý×Ö£¬×Öĸ£¬»òÕßÇ°ÃæÌáµ½µÄ±êµã·û£¬ËüÃǶ¼½«±»×ª»»³É×Ö½ÚÐÎʽ£¬Ã¿¸ö×Ö½Ú¶¼Ð´³ÉÕâÖÖÐÎʽ£ºÒ»¸ö“%”ºóÃæ¸ú×ÅÁ½Î»16½øÖƵÄÊýÖµ¡£¿Õ¸ñÊÇÒ»¸öÌØÊâÇé¿ö£¬ÒòΪËüÃÇ̫ƽ³£ÁË¡£Ëü³ýÁ˱»±àÂë³É“%20”ÒÔÍ⣬»¹ÄܱàÂëΪһ¸ö“+”¡£¼ÓºÅ£¨+£©±¾Éí±»±àÂëΪ%2B¡£µ±/ # = & ºÍ?×÷ΪÃû×ÖµÄÒ»²¿·ÖÀ´Ê¹ÓÃʱ£¬¶ø²»ÊÇ×÷ΪURL²¿·ÖÖ®¼äµÄ·Ö¸ô·ûÀ´Ê¹ÓÃʱ£¬ËüÃǶ¼Ó¦¸Ã±»±àÂë¡£
WARNINGÕâÖÖ²ßÂÔÔÚ´æÔÚ´óÁ¿×Ö·û¼¯µÄÒì¹¹»·¾³ÖÐЧ¹û²»ÉõÀíÏë¡£ÀýÈ磺ÔÚU.S. Windows ϵͳÖÐ, é ±»±àÂëΪ %E9. ÔÚ U.S. MacÖб»±àÂëΪ%8E¡£ÕâÖÖ²»È·¶¨ÐԵĴæÔÚÊÇÏÖ´æµÄURIµÄÒ»¸öÃ÷ÏԵIJ»×ã¡£ËùÒÔÔÚ½«À´URIµÄ¹æ·¶µ±ÖÐÓ¦¸Ãͨ¹ý¹ú¼Ê×
Ïà¹ØÎĵµ£º
Javaѧϰ´ÓÈëÃŵ½¾«Í¨
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......
0
Java WebÓ¦ÓÃÔÚARM Linuxƽ̨ÉϵÄʵÏÖ
Posted in ˶²©ÂÛÎÄ at ʮһÔ 12th, 2009 / No Comments »
Íõ࣬ÖÜÀ¼½£¬ÁõÀñ¶«£¬½âÔÆÏö
(À¥Ã÷Àí¹¤´óѧÐÅÏ¢¹¤³ÌÓë×Ô¶¯»¯Ñ§Ôº£¬ÔÆÄÏÀ¥Ã÷650051)
1ÒýÑÔ
Ëæ×ÅÍøÂçÐÅÏ¢¼¼ÊõµÄ·ÉËÙ·¢Õ¹£¬Web¼¼ÊõÔ½À´Ô½¶àµÄÓÃÔÚ¿ØÖÆÁìÓò£¬¿Í»§¶ËÖ»ÐèÁ¬½ÓÒÔÌ«Íø£¬È¡µÃ·ÃÎÊȨÏÞ£¬¾Í¿ÉÒÔ·Ã ......
Java 7ÒѾÍê³ÉµÄ7´óй¦ÄÜ£º
1£©¶Ô¼¯ºÏÀàµÄÓïÑÔÖ§³Ö£»
2£©×Ô¶¯×ÊÔ´¹ÜÀí£»
3£©¸Ä½øµÄͨÓÃʵÀý´´½¨ÀàÐÍÍƶϣ»
4£©Êý×Ö×ÖÃæÁ¿Ï»®ÏßÖ§³Ö£»
5£©switchÖÐʹÓÃstring£»
6£©¶þ½øÖÆ×ÖÃæÁ¿£»
7£©¼ò»¯¿É±ä²ÎÊý·½·¨µ÷Óá£
ÏÂÃæÎÒÃÇÀ´×Ðϸ¿´Ò»ÏÂÕâ7´óй¦ÄÜ£º
¶Ô¼¯ºÏÀàµÄÓïÑÔÖ§³Ö
Java½«°üº¬¶Ô´´½¨¼¯ºÏÀàµÄµÚÒ»ÀàÓïÑÔÖ§³Ö¡ ......
ÏÂÃæÊÇÓÃjavaʵÏÖµÄÑ¡ÔñÅÅÐò£¬Ã¿´Î´ÓÊý×éÖÐÑ¡È¡×îСµÄÖµ£º
import java.util.Date;
import java.util.Random;
/*
* Ñ¡ÔñÅÅÐò
*/
public class SelectSort {
public static void main(String args[])
{
int len = 40;
Date date = new Date();
Random random = new Random(date.getSeconds());
int ......
inner classºÍouter classÖ®¼äµÄreflectionÓ¦Óá£
package com.gaoqian.reflection;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
class IncludeInn ......