日期:2014-05-20  浏览次数:20769 次

httpClient和servlet的传值问题
  String url="http://localhost:7001/cho1/hello";
        HttpClient httpClient=new HttpClient();
        PostMethod postMethod=new PostMethod(url);
        String a=new Integer(1).toString();
        postMethod.setParameter("id",a);
        postMethod.setParameter("name", "hello");
        postMethod.setParameter("life", "ki");
        try {
            httpClient.executeMethod(postMethod);
        } catch (IOException ex) {
            ex.printStackTrace();
        }
        postMethod.releaseConnection();
上面不知道写的对不 不对的话望指点。。。。
这个传给servlet 在servlet中应该责编呢得到这几个参数?
request.getParameter??
------解决方案--------------------
你这是实现什么功能?在severlet获取参数就是request.getParameter了