在httpClient中获取HttpResponse时出错

时间:2012-10-02 07:24:54

标签: java httpclient

我在获取HttpResponse时收到错误..从服务器端开始写这样的响应

response.setContentType("text/plain");

PrintWriter writer = response.getWriter();

writer.write("login Successfull");

这是我的httpClient代码

HttpClient httpClient = new HttpClient();
PostMethod httpost = new PostMethod("http://localhost:8080/Test/newServlet");
httpost.addParameter("Email" , "my@emial");
httpost.addParameter("name" , "haseeb");
//Getting Error on this line...Saying "Cannot Find Symbol"
HttpResponse response = httpClient.execute(httpost);

0 个答案:

没有答案