我想使用servlet从android向java tomcat服务器发送请求,然后服务器将向客户端发送大量数据,数据包含很多行,每一行都有三个参数:
competitionID, marks, numberOfQuestions
将请求从android发送到服务器的代码
HttpClient client = new DefaultHttpClient();
URI website;
website = new URI("http://" + HostIP
+ ":8080/LocalizedBasedComptitionServer/JoinCompetition");
HttpPost request = new HttpPost();
request.setHeader("ID", ID + "");
request.setURI(website);
HttpResponse response = client.execute(request);
小服务程序代码
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
ServletOutputStream out = response.getOutputStream();
CellDatabase cDB = new CellDatabase();
List<String[]>list = new LinkedList<String[3]>();
out.flush();
}
我如何发送列表list
以及如何接收?