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();
		}
	}

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM