Servlet中的代码是:publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{PrintWriterout=response.getWriter();Stringstr...
Servlet中的代码是:
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
String strClothtypeID = request.getParameter("clothtypeID");
System.out.println("strClothtypeID="+strClothtypeID);
int clothtypeID = Integer.parseInt(URLDecoder.decode(strClothtypeID, "GBK"));
ClothtypedetailServerInter clothtypedetailServer = new ClothtypedetailServer();
System.out.println("clothtypedetailServer"+clothtypedetailServer);
//此句为执行
List list = clothtypedetailServer.queryClothtypedetailByClothtype(clothtypeID);
if (list == null) {
System.out.println("null");
} else {
System.out.println("not null");
}
//转换为js数据对象
JSONArray json = JSONArray.fromObject(list);
out.print(json.toString());
}
ClothtypedetailServerInter是一个接口,ClothtypedetailServer是它的实现,本来执行完上面语句后,list中是有数据的,但是并没有,而且,在ClothtypedetailServer的queryClothtypedetailByClothtype方法中添加:System.out.println("queryClothtypedetailByClothtype"),控制台没有打印queryClothtypedetailByClothtype,这是怎么回事啊,该怎么解决了,在线急等,谢谢啦!!!
展开