package com.zhangjun.test;
import java.io.IOException;
import javax.jms.Session;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import com.sun.org.apache.xerces.internal.dom.DocumentImpl;
import com.zhangjun.xml.AddItem;
public class TableServlet extends HttpServlet {
public void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding("GBK");
response.setContentType("text/html;charset=GBK");
HttpSession session = request.getSession();
Document dom = null;
int iAllotedCount = 0;
AddItem ad = new AddItem();
dom = new DocumentImpl();
Element root = dom.createElement("documents");
dom.appendChild(root);
int j = 1;
for(int i=0;i<100;i++)
{
iAllotedCount++;
Element row = dom.createElement("row");
root.appendChild(row);
row.setAttribute("count", "" + j++);
int jj = 1;
ad.addItem(dom, row,"选择","<input name=\"ch\" type=\"checkbox\" value=\"\" onclick=\"choice();\">","N","HTML",jj++);
ad.addItem(dom, row, "序号", ""+iAllotedCount, "N", "", jj++);
ad.addItem(dom, row, "姓名", "张三", "N", "", jj++);
ad.addItem(dom, row, "性别", "男", "N", "", jj++);
ad.addItem(dom, row, "年龄", "24", "N", "", jj++);
ad.addItem(dom, row, "身高", "177", "N", "", jj++);
ad.addItem(dom, row, "出生日期", "1988-01-16", "N", "", jj++);
ad.addItem(dom, row, "出生地", "山东", "N", "", jj++);
}
if (iAllotedCount == 0)
{
dom = null;
}
session.setAttribute("domList",dom);
response.sendRedirect(request.getContextPath()+"/domList.jsp");
}
}
最近下载更多
最近浏览更多
3334004690 LV11
2024年5月27日
WHY-small LV15
2023年12月29日
ycmyyt LV2
2023年6月6日
qq1154180193
2023年5月21日
暂无贡献等级
2002-GRIT LV2
2023年5月19日
月光skr LV4
2023年4月9日
Gin19960217 LV4
2023年3月28日
aslyyds LV2
2023年1月28日
微信网友_6270418622812160 LV3
2022年12月21日
呵呵哈哈哈 LV10
2022年9月25日

