controller方法调用另外的controller方法

controller方法调用另外的controller方法

利用POST方式传递参数

private void client(String name) {
		HttpClient httpclient = new HttpClient();
		PostMethod httpPost = new PostMethod("http://" + lhUrl + "//baidu.do);
		NameValuePair[] param = { new NameValuePair("name", name) };
		httpPost.setRequestBody(param);
		try {
			httpclient.executeMethod(httpPost);
		} catch (HttpException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally {
			httpPost.releaseConnection();
		}
	}

  

posted @ 2016-10-13 13:55  猪肉炖粉条  阅读(17638)  评论(0编辑  收藏  举报