GetCategoryChilds.jsp
上传用户:lsj999sz
上传日期:2022-06-15
资源大小:4717k
文件大小:1k
源码类别:

ICQ/即时通讯

开发平台:

Java

  1. <%@ page language="java" import="com.bjsxt.shopping.category.*, java.util.*" %>
  2. <%
  3. int id = Integer.parseInt(request.getParameter("id"));
  4. List<Category> childs = CategoryService.getInstance().getChilds(id) ;
  5. System.out.println(childs.size());
  6. StringBuffer buf = new StringBuffer();
  7. buf.append("document.frm.child.length = " + (childs.size()+1) + ";n");
  8. buf.append("document.frm.child.options[0].value = '-1';n");
  9. buf.append("document.frm.child.options[0].text = 'Pls Select!';n");
  10. buf.append("document.frm.child.selectedIndex = 0;n");
  11. for(int i=0; i<childs.size(); i++) {
  12. Category c = childs.get(i);
  13. buf.append("document.frm.child.options[" + (i+1) + "].value = '" + c.getId() + "';n");
  14. buf.append("document.frm.child.options[" + (i+1) + "].text = '" + c.getName() + "';n");
  15. }
  16. response.setContentType("text/html;charset=gbk");
  17. response.setHeader("Cache-Control", "no-store"); //HTTP1.1
  18. response.setHeader("Pragma", "no-cache"); //HTTP1.0
  19. response.setDateHeader("Expires", 0); //prevents catching at proxy server
  20. response.getWriter().write(buf.toString());
  21. %>