摘要: 在上篇文章《多线程的使用——Thread类和Runnable接口》中提到中断线程的问题。在JAVA中,曾经使用stop方法来停止线程,然而,该方法具有固有的不安全性,因而已经被抛弃(Deprecated)。那么应该怎么结束一个进程呢?官方文档中对此有详细说明:《为何不赞成使用 Thread.stop、Thread.suspend 和 Thread.resume?》。在此引用stop方法的说明:1. Why is Thread.stop deprecated?Because it is inherently unsafe. Stopping a thread causes it to unloc 阅读全文
posted @ 2013-07-07 12:14 大新博客 阅读(2307) 评论(0) 推荐(0) 编辑
摘要: jre -DproxySet=true -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8888 Or:jre -DproxySet=true -DproxyHost=127.0.0.1 -DproxyPort=8888 MyAppOr, change the Java Virtual Machine's proxy settings programmatically: System.setProperty("http.proxyHost", "127.0.0.1"); System.setProperty 阅读全文
posted @ 2013-07-02 09:01 大新博客 阅读(387) 评论(0) 推荐(0) 编辑
摘要: package org.apache.http.examples.client;import org.apache.http.HttpEntity;import org.apache.http.HttpHost;import org.apache.http.HttpResponse;import org.apache.http.auth.AuthScope;import org.apache.http.auth.UsernamePasswordCredentials;import org.apache.http.client.methods.HttpGet;import org.apache. 阅读全文
posted @ 2013-07-01 22:42 大新博客 阅读(1563) 评论(0) 推荐(0) 编辑
摘要: Tomcat性能优化之(一) 启动GZIP压缩1:设置TOMCAT启用GZIP压缩,通过浏览器HTTP访问对应的资源会根据配置进行压缩。 从上面节点的属性可以看出,要使用GZIP压缩功能,你需要在Connector节点中加上如下属性:compression="on" 启动压缩功能。compre... 阅读全文
posted @ 2013-07-01 20:04 大新博客 阅读(3072) 评论(0) 推荐(0) 编辑
摘要: /* * ==================================================================== * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF... 阅读全文
posted @ 2013-07-01 17:15 大新博客 阅读(1171) 评论(0) 推荐(0) 编辑
摘要: /* * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF lice.. 阅读全文
posted @ 2013-07-01 17:12 大新博客 阅读(833) 评论(0) 推荐(0) 编辑
摘要: /* * ==================================================================== * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF... 阅读全文
posted @ 2013-07-01 16:58 大新博客 阅读(825) 评论(0) 推荐(0) 编辑
摘要: public class Test { public static void main(String[] args) throws IOException { DefaultHttpClient httpclient = new DefaultHttpClient(); try { HttpPost httpost = new HttpPost("http://localhost:8080/task/index.jsp"); List nvps = new ArrayList (); ... 阅读全文
posted @ 2013-07-01 16:51 大新博客 阅读(1191) 评论(0) 推荐(0) 编辑
摘要: package org.apache.http.examples.client;import java.util.List;import org.apache.http.HttpEntity;import org.apache.http.HttpResponse;import org.apache.http.client.CookieStore;import org.apache.http.client.HttpClient;import org.apache.http.client.methods.HttpGet;import org.apache.http.client.protocol. 阅读全文
posted @ 2013-07-01 16:43 大新博客 阅读(2610) 评论(0) 推荐(0) 编辑
摘要: package org.apache.http.examples.client;import org.apache.http.HttpEntity;import org.apache.http.HttpResponse;import org.apache.http.client.HttpClient;import org.apache.http.client.methods.HttpGet;import org.apache.http.impl.client.DefaultHttpClient;/** * This example demonstrates how to abort an HT 阅读全文
posted @ 2013-07-01 16:29 大新博客 阅读(503) 评论(0) 推荐(0) 编辑