¼¸ÖÖÍøÒ³ÅÀÈ¡µÄ·½·¨ÓëʵÏÖ(Java)
Ò»¡¢Í¨¹ýHttpClient(apache commons-httpclient)·½Ê½£¬»ñÐíÍøÒ³ÄÚÈÝ£¬²¢½âÎö³öÐèÒªµÄ¶«Î÷¡£
ÕâÖÖ·½·¨Ïà¶Ô±È½Ï¼òµ¥£¬ÒòΪcommons-httpclientÒѾ×öÁ˺ܺõķâ×°£¬¼òµ¥µÄ´úÂëÈçÏ£º
// ¹¹ÔìHttpClientµÄʵÀý
HttpClient httpClient = new HttpClient();
HttpClientParams clientParams = new HttpClientParams();
// Òþ²Ø×Ô¼ºÇëÇóÏà¹ØµÄÐÅÏ¢
clientParams.setParameter("http.useragent",
"Mozilla/4.0 (compatible; FIREFOX 9.0; IBM AIX 5)");
clientParams.setHttpElementCharset("GBK");
HttpState httpState = new HttpState();
httpClient.setParams(clientParams);
httpClient.getParams().setParameter(
HttpClientParams.HTTP_CONTENT_CHARSET, "GBK");
httpClient.setState(httpState);
clientParams.setVersion(HttpVersion.HTTP_1_1);
if (useProxy) // ʹÓôúÀí
{
httpClient.getHostConfiguration().setProxy(proxyIp, port);
}
ÕâÀïÐèҪעÒâµÄÊǼǵÃÉèÖÃhttp.useragentÊôÐÔ£¬Ä¬ÈÏ»áÏÔʾΪhttpclient´úÀí£¬ºÜ¶àÍøվΪÁË·ÀÖ¹±»¶ñÒâÅÀÈ¡£¬×î¼òµ¥µÄ·½Ê½¾ÍÊÇÅжÏuseragentÊôÐÔ¡£
¶þ¡¢µÚÒ»ÖÖ·½Ê½×î¼òµ¥£¬µ«ÊÇÒ²×îÈÝÒ×±»ÍøÕ¾½ûÖ¹µô£¬ÒòΪÕâÖÖ·½Ê½ÊDz»»áÖ´ÐÐjavascriptµÄ£¬ÕâÑù¾ÍºÜÈÝÒ×±»Íøվͨ¹ýjavascript×ö±êʶʶ±ð³öÀ´£¬Í¬Ê±»ñÈ¡µÄÊý¾ÝÈç¹ûÊÇͨ¹ýjavascript¼ÆËãÀ´µÄ£¬Ò²»á±È½ÏÂé·³¡£
ÄÇô£¬ÎÒÃÇÀ´¿´µÚ¶þÖÖ·½Ê½£¬Í¨¹ýÄ£ÄâÕæÕýµÄbrowserÀ´»ñÈ¡ÍøÒ³ÄÚÈÝ£¬²¢Ö´ÐÐjavascript£¬Ä¿Ç°´ó²¿·ÖÁ÷ÐеÄä¯ÀÀÆ÷Äں˶¼ÊÇ¿ª·ÅµÄ£¬±ÈÈçwebkit£¬ÏÂÃæÎÒÃÇÒÔmozillaÒýÇæΪÀý£¬ÊµÏÖÈçÏ£º
Ê×ÏÈ£¬ÎÒÃÇ»áÓõ½xulrunner£¬ÕâÊÇʹÓÃmozillaÒýÇæµÄxulä¯ÀÀÆ÷£¬ÔÚÕâÀïÎÒÃÇÓÃÀ´Ìæ´úmozillaʵÏÖ¡£
ÏÂÔØxulrunnerºó£¬½âѹËõµ½ÏàӦĿ¼
ÔÚ´úÂëÖнøÐÐÅäÖá£
static {
Mozilla.getInstance().initialize(new File("D:\\xulrunner"));
System.setProperty("org.eclipse.swt.browser.XULRunnerPath",
"D:\\xulrunner");
}
½«´úÂëÖеÄxulrunnerĿ¼λÖÃÐÞ¸ÄΪÄã½âѹËõµÄλÖá£
ÎÒÃÇʹÓÃSWTÀ´ÊµÏÖ½çÃ棬SWTµÄBrowser¿Ø¼þ¿ÉÒÔʹÓöà¸öä¯ÀÀÆ÷ÒýÇ棬ÉèÖÃÈçÏÂ
Ïà¹ØÎĵµ£º
1 jsp »ù´¡¸ÅÄî
jspÊÇÔÚ´«Í³µÄhtmlÒ³ÃæÖУ¬¼ÓÈëjavaµÄ³ÌÐòƬ¶ÎºÍjsp±ê¼Ç£¬¾Í¹¹³ÉÁËjspÒ³Ãæ¡£µ±web·þÎñÆ÷Óöµ½¶ÔjspµÄ·ÃÎÊÇëÇóʱ£¬ÏÈÖ´ÐжÔÆäÖеÄjava³ÌÐòƬ¶Î£¬È»ºóÒÔhtmlµÄ¸ñʽ·µ»Ø¸øÓû§¡£ java³ÌÐòƬ¶Î¿ÉÒÔÓÃÀ´²Ù×÷Êý¾Ý¿â£¬Öض¨ÏòÍøÒ³£¬»òÕßÊÇ·¢ËÍE-mail ,ÑéÖ¤µÇ½ÐÅÏ¢£¬ ÕâЩ²Ù×÷¶¼ÊÇÔÚ·þÎñÆ ......
×÷Õß:cleverpig(×÷ÕßµÄBlog:http://blog.matrix.org.cn/page/cleverpig
)
ÔÎÄ:http://www.matrix.org.cn/resource/article/44/44055_Java+Annotation+Reflect.html
¹Ø¼ü×Ö:java,annotation,reflect
ÔĶÁÌáʾ£ºÎÄÖÐÌáµ½µÄ³ÌÐò³ÉÔ±»òÕß³ÌÐòÔªËØÊÇÒ»¸ö¸ÅÄָ×é³É³ÌÐò´úÂëµÄµ¥Ôª£ºÈçÀà¡¢·½·¨¡¢³ÉÔ±±äÁ¿¡£
Ò»¡¢Annotatio ......
ÀàµÄÊý¾Ý³ÉÔ±ÔÚδ±»³õʼ»¯Ê±»á±£Ö¤±»¸³ÓèĬÈÏÖµ
boolean false
char []
byte 0
short 0
int 0
long 0
float 0.0
double 0.0
reference null
1.Ö¸¶¨³õʼ»¯¡£ÔÚ¶¨ÒåÀà³ÉÔ±±äÁ¿µÄµØ·½ÎªÆ丳ֵ£¬¿ÉÒÔͨ¹ýµ÷ÓÃij¸ö·½·¨À´Ìṩ³õʼֵ
µ«ÕâÑùÓиöÏÞÖƾÍÊÇÀàµÄ¶ÔÏó ......