程序猿全敏的gravatar头像
程序猿全敏 2017-10-30 23:01:08

spring MVC图书后台管理系统开发(一)

首先我希望首先看看这两篇文章

1.手把手搭建一个简易的图片文件tomcat服务器

2.java上传文件到本地服务器实例详解

首先,我之前发过

手把手教你们通过jquery ajax调用查询java struts2后端数据+js拼接字符串

手把手教你们通过jquery ajax调用查询java servlet后端数据+js拼接字符串

这个里面有手把手教你们通过jquery ajax调用查询springMVC 后端数据+js拼接字符串

就发这个主要代码 js代码

$.ajax({
		url : "<%=basePath%>"+"file/fileList",
			type : "post",
			dataType : "json",
			success : function(data) {
				console.log(data);
				for(var i=0;i<data.length;i++){
					 var str1 ="<tr><td><input name='' type='checkbox' value='' /></td>";
					 var str2 ="<td>"+data[i].fileid+"</td>"
					 var str3="<td>"+data[i].filename+"</td>";
					 var str4="<td>"+data[i].uplodetime+"</td><td><a href='"+data[i].fileurl+"' target='pdfContainer' onclick='showPdf(true)'>浏览<a></td>";
					 var str5 ="<td><a href='#' class='tablelink'>查看</a>     <a href='#' class='tablelink'> 删除</a></td></tr>";
					 var html=str1+str2+str3+str4+str5;
					 $('#fileList').append(html);
				}
			}
	});

控制层代码

/**
	 * 查找所有文件
	 * @param request
	 * @param response
	 * @throws Exception
	 */
	@RequestMapping("/fileList")
	public void fileList(HttpServletRequest request,HttpServletResponse response) throws Exception{
		
		List<LearnFile> fileList=fileService.fileList();
		JSONArray jsonArray = JSONArray.fromObject(fileList);
		response.setContentType("application/json");
		try {
			PrintWriter out = response.getWriter();
			String json = jsonArray.toString();
			out.write(json);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

spring MVC图书后台管理系统开发(一)spring MVC图书后台管理系统开发(一)

本代码包包含了

1.用户登录

2.文件服务器

3.文件浏览

4.文件上传

5.文件列表

等继续更新图书系统开发(二)


打赏

已有1人打赏

最代码官方的gravatar头像

文件名:fdreamProject.rar,文件大小:18593.41K 下载
  • /
      • /fdreamProject
        • /fdreamProject/.classpath
        • /fdreamProject/.project
          • /fdreamProject/.settings
            • /fdreamProject/.settings/.jsdtscope
            • /fdreamProject/.settings/org.eclipse.jdt.core.prefs
            • /fdreamProject/.settings/org.eclipse.wst.common.component
            • /fdreamProject/.settings/org.eclipse.wst.common.project.facet.core.xml
            • /fdreamProject/.settings/org.eclipse.wst.jsdt.ui.superType.container
            • /fdreamProject/.settings/org.eclipse.wst.jsdt.ui.superType.name
          • /fdreamProject/build
              • /fdreamProject/build/classes
                  • /fdreamProject/build/classes/com
                      • /fdreamProject/build/classes/com/fdream
                          • /fdreamProject/build/classes/com/fdream/controller
                            • /fdreamProject/build/classes/com/fdream/controller/FileController.class
                            • /fdreamProject/build/classes/com/fdream/controller/UserController.class
最代码最近下载分享源代码列表最近下载
lyq6666666  LV5 2023年10月25日
zzfzzf  LV7 2022年9月22日
zhang123qaz  LV2 2022年8月14日
levelhspdf  LV7 2022年6月22日
程序猿全敏  LV29 2022年5月9日
非大傻  LV2 2022年2月19日
寂寞仓颉  LV2 2020年6月9日
957447265  LV3 2020年5月25日
13720151521  LV7 2020年1月3日
ccwwcc  LV4 2020年1月1日
最代码最近浏览分享源代码列表最近浏览
吞吞吐吐她  LV4 1月18日
duoduo1234  LV2 1月15日
WBelong  LV7 2023年12月27日
17693282606  LV11 2023年12月26日
Aban-beautiful 2023年12月16日
暂无贡献等级
周青松  LV3 2023年12月10日
xiongwei11231  LV8 2023年12月1日
15694996276  LV1 2023年11月21日
刘洋66666  LV1 2023年11月5日
lyq6666666  LV5 2023年10月25日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友