1. jsp <body> <button onclick="getItemList()">获取商品列表</button> <div id="list"></div> </body> 2. js <mce:script type="text/javascript"><!-- function getItemList(){ var url = "<%=path%>/item/itemlist.action"; $.get(url,null,function (record) { $("#list").html(record); }); } // --></mce:script> 3. action public String itemList() throws IOException { list = getItemList(); StringBuffer sb = new StringBuffer("<table class='listView'><thead><tr><th>"); sb.append("ID").append("</th>").append("<th>"); sb.append("itemName").append("</th>").append("<th>"); sb.append("itemType").append("</th>").append("<th>"); sb.append("itemDesc").append("</th>").append("<th>"); sb.append("createTime").append("</th>").append("</tr></thead>"); for (int i = 0; i < list.size(); i++) { Item item = list.get(i); sb.append("<tr><td>"); sb.append(item.getId()).append("</td>").append("<td>"); sb.append(item.getItemName()).append("</td>").append("<td>"); sb.append(item.getItemType()).append("</td>").append("<td>"); sb.append(item.getItemDesc()).append("</td>").append("<td>"); sb.append(item.getCreateTime()).append("</td></tr>"); } sb.append("</table>"); HttpServletResponse response = ServletActionContext.getResponse(); response.setCharacterEncoding("UTF-8"); PrintWriter out = response.getWriter(); response.setCharacterEncoding("UTF-8"); out.write(sb.toString()); out.flush(); out.close(); return null; } 有需要的可以PM我,我给demo源码;