• 大小: 18.34MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-01
  • 语言: Html/CSS
  • 标签: datatables  

资源简介

datatables+springmvc+bootstrap实现分页,包含数据库 Datatables是一款jquery表格插件。它是一个高度灵活的工具,可以将任何HTML表格添加高级的交互功能。 分页,即时搜索和排序 几乎支持任何数据源:DOM, javascript, Ajax 和 服务器处理 支持不同主题 DataTables, jQuery UI, Bootstrap, Foundation 各式各样的扩展: Editor, TableTools, FixedColumns …… 丰富多样的option和强大的API 支持国际化 超过2900+个单元测试 免费开源 ( MIT license )! 商业支持 更多特性请到官网查看

资源截图

代码片段和文件信息

package com.smxy.lq.controller;

import java.io.IOException;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.linkedHashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.smxy.lq.pojo.ZhangScore;
import com.smxy.lq.service.ZhangScoreService;
import com.smxy.lq.utils.ExportCsvUtil;


@Controller
public class ZhangScoreController {
@Autowired
private ZhangScoreService zhangScoreService;

@RequestMapping(“/showZhangScoreService“)
@ResponseBody
public Mapject> showZhangScoreService() throws Exception {
List ZhangScorelist = zhangScoreService.selsectAllZhangScore();
System.out.println(ZhangScorelist.size());
ZhangScore zhangScore= zhangScoreService.selectByPrimaryKey(29);
System.out.println(zhangScore.toString());
Mapject> map2Json = new HashMapject>();
map2Json.put(“aaData“ ZhangScorelist);
return map2Json;
}
@RequestMapping(“/export“)
public void exportcsv(HttpServletRequest requestHttpServletResponse response) throws Exception{
     SimpleDateFormat f = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss“);
     List exportData = new ArrayList();
List list=  zhangScoreService.selsectAllZhangScore();
if(list!=null){
for (ZhangScore d:list) {
 Map row = new linkedHashMap();
 row.put(“1“ d.getUserId());
 row.put(“2“ d.getUserName());
 row.put(“3“ d.getFrist()+““);
 row.put(“4“ d.getSecond()+““);
 row.put(“5“ d.getThrid()+““);
 row.put(“6“ d.getTotal()+““);
 exportData.add(row);
}
   linkedHashMap map = new linkedHashMap();
        map.put(“1“ “学号“);
        map.put(“2“ “姓名“);
        map.put(“3“ “章节得分“);
        map.put(“4“ “oj习题得分“);
        map.put(“5“ “智能达标测试得分“);
        String fileName=String.valueOf(“信息“+new Date().getTime());
        try {
            response.setHeader(“Content-Disposition“ “attachment; filename=“+URLEncoder.encode(fileName “UTF-8“)+“.csv“);
            response.setContentType(“application/csv“);
         //response.setContentType(“application/x-msdownload“);  txt
            response.setCharacterEncoding(“UTF-8“);
            
            String agent = request.getHeader(“User-Agent“);
            boolean isMSIE = (agent != null && agent.indexOf(“MSIE“) != -1);
            if( isMSIE ){
             fileName = URLEncoder.encode(fileName“UTF8“);
            }else{
            

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       4845  2018-05-03 11:21  datatables+springmvc+bootstrap实现分页\Bushluo\.classpath

     文件       1040  2018-03-28 19:52  datatables+springmvc+bootstrap实现分页\Bushluo\.project

     文件        503  2018-03-28 19:52  datatables+springmvc+bootstrap实现分页\Bushluo\.settings\.jsdtscope

     文件        364  2018-03-28 19:52  datatables+springmvc+bootstrap实现分页\Bushluo\.settings\org.eclipse.jdt.core.prefs

     文件        473  2018-03-28 19:52  datatables+springmvc+bootstrap实现分页\Bushluo\.settings\org.eclipse.wst.common.component

     文件        345  2018-03-28 19:52  datatables+springmvc+bootstrap实现分页\Bushluo\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2018-03-28 19:52  datatables+springmvc+bootstrap实现分页\Bushluo\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2018-03-28 19:52  datatables+springmvc+bootstrap实现分页\Bushluo\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       5399  2018-05-04 21:34  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\controller\ZhangScoreController.class

     文件        496  2018-05-01 16:28  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\dao\UserMapper.class

     文件        534  2018-05-04 19:56  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\dao\ZhangScoreMapper.class

     文件       2115  2018-03-24 21:24  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\mapping\UserMapper.xml

     文件       4397  2018-05-04 20:20  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\mapping\ZhangScoreMapper.xml

     文件        364  2018-05-02 19:33  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\pojo\Data.class

     文件       1580  2018-05-02 19:54  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\pojo\DatatablesView.class

     文件       1916  2018-05-01 16:28  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\pojo\Items.class

     文件       1178  2018-05-03 15:27  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\pojo\Name.class

     文件       1789  2018-05-03 15:42  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\pojo\Person.class

     文件       1881  2018-05-03 15:27  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\pojo\Student.class

     文件       1195  2018-05-03 16:07  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\pojo\TestUser.class

     文件       2219  2018-05-03 10:54  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\pojo\User.class

     文件       4324  2018-05-03 21:46  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\pojo\ZhangScore.class

     文件        610  2018-05-01 16:28  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\service\UserService.class

     文件        648  2018-05-04 19:56  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\service\ZhangScoreService.class

     文件       1729  2018-05-01 16:28  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\serviceimpl\UserServiceImpl.class

     文件       1773  2018-05-04 19:57  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\serviceimpl\ZhangScoreServiceImpl.class

     文件        551  2018-05-03 15:31  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\test\JsonTest$1.class

     文件        568  2018-05-03 15:31  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\test\JsonTest$2.class

     文件       3985  2018-05-03 15:31  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\test\JsonTest.class

     文件       2388  2018-05-03 16:05  datatables+springmvc+bootstrap实现分页\Bushluo\build\classes\com\smxy\lq\test\Snippet.class

............此处省略231个文件信息

评论

共有 条评论

相关资源