zoukankan      html  css  js  c++  java
  • 20151229--数据表格

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>数据表格</title>
    
    <script type="text/javascript" src="js/jquery-easyui-1.4.4/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="js/jquery-easyui-1.4.4/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="js/jquery-easyui-1.4.4/themes/icon.css">
    <script type="text/javascript" src="js/jquery-easyui-1.4.4/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="js/jquery-easyui-1.4.4/locale/easyui-lang-zh_CN.js"></script>
    <script>
    $(function()
    {
        
    })
    </script>
    </head>
    <body>
    <table id="mydatagrid" title="地区列表" class="easyui-datagrid" style="100%;height:500px"
    data-options="collapsible:true,url:'MembersList?parentid=0'">
    <thead>
    <tr>
    <th data-options="field:'id',80">ID</th>
    <th data-options="field:'parentid',80">父ID</th>
    <th data-options="field:'name',80">地区名</th>
    <th data-options="field:'postCode',80">邮编</th>
    </tr>
    </thead>
    </table>
    </body>
    </html>
    package com.hanqi;
    
    import java.io.IOException;
    import java.util.ArrayList;
    
    import javax.servlet.ServletException;
    import javax.servlet.annotation.WebServlet;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    
    import com.alibaba.fastjson.JSON;
    import com.hanqi.dao.Members;
    import com.hanqi.dao.MembersDAL;
    
    /**
     * Servlet implementation class MembersList
     */
    @WebServlet("/MembersList")
    public class MembersList extends HttpServlet {
        private static final long serialVersionUID = 1L;
           
        /**
         * @see HttpServlet#HttpServlet()
         */
        public MembersList() {
            super();
            // TODO Auto-generated constructor stub
        }
    
        /**
         * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
         */
        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    
            request.setCharacterEncoding("UTF-8");
            
            response.setContentType("text/html;charset=UTF-8");
            
            response.setCharacterEncoding("UTF-8");
            
    
            String rtn = "";
            
    String pid = request.getParameter("parentid");
    
    if (pid == null || pid.trim().length() == 0 )
    {
        pid = "-1";
    }
    
    int iPid = Integer.parseInt(pid);
    
    MembersDAL md = new MembersDAL();
    
    ArrayList<Members> al;
    
    try
    {
        al = md.getList(iPid);
        if(al != null)
        {
            rtn = "{"total":20,"rows":" + JSON.toJSONString(al) + "}";
        }
    }
    catch (Exception e)
    {
        e.printStackTrace();
    }
    
        response.getWriter().print(rtn);
    }
    
        /**
         * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
         */
        protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            
            doGet(request, response);
        }
    
    }
  • 相关阅读:
    Odoo开发教程15-管理 Odoo 数据库
    星辉信息科技Odoo开发教程14-源码安装 Odoo第三讲
    星辉信息科技Odoo开发教程13-源码安装 Odoo第二讲
    Odoo开发教程12-源码安装 Odoo
    星辉信息科技Odoo开发教程11-使用 Windows 子系统安装 Linux
    Metasploit 进阶
    Metasploit 一些重要模块使用介绍
    Metasploit 使用基础
    【译】Attacking XML with XML External Entity Injection (XXE)
    CentOS6 安装Sendmail + Dovecot + Roundcubemail
  • 原文地址:https://www.cnblogs.com/name-hanlin/p/5087027.html
Copyright © 2011-2022 走看看