一:Spring整合SpringMVC

1:编写web.xml,配置DispatcherServlet

  1. <web-app xmlns="http://java.sun.com/xml/ns/javaee"
  2. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
  4. http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
  5. version="3.0"
  6. metadata-complete="true">
  7.  
  8. <servlet>
  9. <servlet-name>seckill-dispatcher</servlet-name>
  10. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  11. <!-- 指明配置文件路径 -->
  12. <init-param>
  13. <param-name>contextConfigLocation</param-name>
  14. <param-value>classpath:spring/spring-*.xml</param-value>
  15. </init-param>
  16. </servlet>
  17. <servlet-mapping>
  18. <servlet-name>seckill-dispatcher</servlet-name>
  19. <!-- 默认匹配所有请求 -->
  20. <url-pattern>/</url-pattern>
  21. </servlet-mapping>
  22. </web-app>

2:在resource/spring下,新建spring-web.xml,整合SpringMVC

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
  4. xmlns:context="http://www.springframework.org/schema/context"
  5. xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
  6. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  7. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd">
  8. <!-- 1:开启注解模式 -->
  9. <mvc:annotation-driven/>
  10. <!-- 2:配置静态资源默认处理器-->
  11. <mvc:default-servlet-handler/>
  12. <!-- 3:配置JSP视图解析器 -->
  13. <bean
  14. class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  15. <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
  16. <property name="prefix" value="/WEB-INF/jsp/" />
  17. <property name="suffix" value=".jsp" />
  18. </bean>
  19. <!-- 4:配置扫描controller所在包 -->
  20. <context:component-scan base-package="org.myseckill.web"/>
  21. </beans>

二:SpringMVC controller开发并实现restful url设计

RestFul架构见博客:http://kb.cnblogs.com/page/512047/

Restful url 格式:/模块/资源/{id}/细分

1:在org.myseckill包下新建web包,用于存放所有controller。

2:web包下新建一个controller:SeckillController

  1. package org.myseckill.web;
  2.  
  3. import java.util.Date;
  4. import java.util.List;
  5.  
  6. import org.junit.runners.Parameterized.Parameter;
  7. import org.myseckill.entity.Seckill;
  8. import org.myseckill.exception.RepeatKillException;
  9. import org.myseckill.service.SeckillService;
  10. import org.myseckill.dto.Exposer;
  11. import org.myseckill.dto.SeckillExecution;
  12. import org.myseckill.dto.SeckillResult;
  13. import org.myseckill.enums.SeckillStateEnum;
  14. import org.myseckill.exception.*;
  15. import org.slf4j.Logger;
  16. import org.slf4j.LoggerFactory;
  17. import org.springframework.beans.factory.annotation.Autowired;
  18. import org.springframework.stereotype.Controller;
  19. import org.springframework.ui.Model;
  20. import org.springframework.web.bind.annotation.CookieValue;
  21. import org.springframework.web.bind.annotation.PathVariable;
  22. import org.springframework.web.bind.annotation.RequestMapping;
  23. import org.springframework.web.bind.annotation.RequestMethod;
  24. import org.springframework.web.bind.annotation.ResponseBody;
  25. @Controller//注册该bean
  26. @RequestMapping("/seckill")//映射项目模块
  27. public class SeckillController {
  28. private final Logger logger = LoggerFactory.getLogger(this.getClass());
  29. @Autowired
  30. private SeckillService seckillService;
  31. //列表页请求
  32. @RequestMapping(value="/list",method=RequestMethod.GET)
  33. public String list(Model model){//model用于存放数据,字符串用于控制跳转
  34. List<Seckill> list=seckillService.getSeckillList();
  35. model.addAttribute("list",list);
  36. return "list";
  37. }
  38.  
  39. //详情页请求
  40. @RequestMapping(value="/{seckillId}/detail",method=RequestMethod.GET)
  41. public String detail(@PathVariable("seckillId")Long seckillId,Model model){
  42.  
  43. if (seckillId == null) {
  44. return "redirect:/seckill/list";
  45. }
  46. Seckill seckill = seckillService.getById(seckillId);
  47. if (seckill == null) {
  48. return "forward:/seckill/list";
  49. }
  50. model.addAttribute("seckill", seckill);
  51. return "detail";
  52. }
  53.  
  54. @RequestMapping(value="/{seckillId}/exposer",method=RequestMethod.POST,produces={"application/json;charset=UTF-8"})
  55. @ResponseBody//把返回数据转换成JSON格式,绑定到响应中
  56. //Ajax方法,返回JSON数据
  57. public SeckillResult<Exposer> exposer(@PathVariable Long seckillId){
  58. SeckillResult<Exposer> result;
  59. try {//成功
  60. Exposer exposer = seckillService.exportSeckillUrl(seckillId);
  61. result = new SeckillResult<Exposer>(true,exposer);
  62. } catch (Exception e) {//失败
  63. logger.error(e.getMessage(),e);
  64. result = new SeckillResult<Exposer>(false,e.getMessage());
  65. }
  66. return result;
  67. }
  68.  
  69. @RequestMapping(value="/{seckillId}/{md5}/execution",method=RequestMethod.POST,produces={"application/json;charset=UTF-8"})
  70. @ResponseBody
  71. public SeckillResult<SeckillExecution> execute(@PathVariable Long seckillId, @PathVariable String md5,@CookieValue(value = "killPhone", required = false) Long userPhone) {
  72. if(userPhone==null){
  73. return new SeckillResult<SeckillExecution>(false, "未注册");
  74. }
  75. try {
  76. SeckillExecution execution=seckillService.executeSeckill(seckillId, userPhone, md5);
  77. return new SeckillResult<SeckillExecution>(true, execution);
  78. } catch (RepeatKillException e) {
  79. SeckillExecution execution = new SeckillExecution(seckillId, SeckillStateEnum.REPEAT_KILL);
  80. return new SeckillResult<SeckillExecution>(true,execution);
  81. } catch (SeckillException e) {
  82. SeckillExecution execution = new SeckillExecution(seckillId, SeckillStateEnum.END);
  83. return new SeckillResult<SeckillExecution>(true,execution);
  84. } catch (Exception e){
  85. SeckillExecution execution = new SeckillExecution(seckillId, SeckillStateEnum.INNER_ERROR);
  86. return new SeckillResult<SeckillExecution>(false,execution);
  87. }
  88. }
  89.  
  90. @RequestMapping(value="/time/now",method=RequestMethod.GET)
  91. @ResponseBody
  92. public SeckillResult<Long> time(){
  93. Date now = new Date();
  94. return new SeckillResult<Long>(true,now.getTime());
  95. }
  96. }

3:新建一个dto:SeckillResult,封装controller的处理结果

  1. package org.seckill.dto;
  2.  
  3. //所有ajax请求返回类型,封装json结果
  4. public class SeckillResult<T> {
  5. private boolean success;//请求是否成功
  6.  
  7. private T data;
  8.  
  9. private String error;
  10.  
  11. public SeckillResult(boolean success, T data) {
  12. super();
  13. this.success = success;
  14. this.data = data;
  15. }
  16.  
  17. public SeckillResult(boolean success, String error) {
  18. super();
  19. this.success = success;
  20. this.error = error;
  21. }
  22.  
  23. public boolean isSuccess() {
  24. return success;
  25. }
  26.  
  27. public void setSuccess(boolean success) {
  28. this.success = success;
  29. }
  30.  
  31. public T getData() {
  32. return data;
  33. }
  34.  
  35. public void setData(T data) {
  36. this.data = data;
  37. }
  38.  
  39. public String getError() {
  40. return error;
  41. }
  42.  
  43. public void setError(String error) {
  44. this.error = error;
  45. }
  46. }

三:页面开发

在WEB-INF下新建文件夹jsp,用于存放所有页面。

1:jsp文件夹下新建common文件夹,用于存放一些共用的jsp页面头/尾。

head.jsp:

  1. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  2. <!-- 引入 Bootstrap -->
  3. <link
  4. href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css"
  5. rel="stylesheet">
  6.  
  7. <!-- HTML5 Shim 和 Respond.js 用于让 IE8 支持 HTML5元素和媒体查询 -->
  8. <!-- 注意: 如果通过 file:// 引入 Respond.js 文件,则该文件无法起效果 -->
  9. <!--[if lt IE 9]>
  10. <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  11. <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
  12. <![endif]-->
  13. <%
  14. String path = request.getContextPath();
  15. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  16. %>
  17. <base href="<%=basePath %>">

tag.jsp:

  1. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  2. <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

2:创建页面jsp

列表页list.jsp:

  1. <%@ page language="java" contentType="text/html; charset=utf-8"
  2. pageEncoding="utf-8"%>
  3. <%@include file="common/tag.jsp"%>
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <title>秒杀列表页</title>
  8. <%@include file="common/head.jsp"%>
  9. </head>
  10. <body>
  11. <div class="container">
  12. <div class="panel panel-default">
  13. <div class="panel-heading text-center">
  14. <h2>秒杀列表</h2>
  15. </div>
  16. <div class="panel-body">
  17. <table class="table table-hover">
  18. <thead>
  19. <tr>
  20. <th>名称</th>
  21. <th>库存</th>
  22. <th>开始时间</th>
  23. <th>结束时间</th>
  24. <th>创建时间</th>
  25. <th>详情页</th>
  26. </tr>
  27. </thead>
  28. <tbody>
  29. <c:forEach var="sk" items="${list}">
  30. <tr>
  31. <td>${sk.name}</td>
  32. <td>${sk.number}</td>
  33. <td>
  34. <fmt:formatDate value="${sk.startTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
  35. </td>
  36. <td>
  37. <fmt:formatDate value="${sk.endTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
  38. </td>
  39. <td>
  40. <fmt:formatDate value="${sk.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
  41. </td>
  42. <td>
  43. <a class="btn btn-info" href="seckill/${sk.seckillId}/detail" target="_blank">link</a>
  44. </td>
  45. </tr>
  46. </c:forEach>
  47. </tbody>
  48. </table>
  49. </div>
  50. </div>
  51. </div>
  52.  
  53. </body>
  54. <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
  55. <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
  56.  
  57. <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
  58. <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  59.  
  60. </html></th>

2:详情页detail.jsp

  1. <%@ page language="java" contentType="text/html; charset=utf-8"
  2. pageEncoding="utf-8"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title>秒杀详情页</title>
  7. <%@include file="common/head.jsp"%>
  8. </head>
  9. <body>
  10. <div class="container">
  11. <div class="panel panel-default text-center">
  12. <div class="panel-heading">
  13. <h1>${seckill.name}</h1>
  14. </div>
  15. <div class="panel-body">
  16. <h2 class="text-danger">
  17. <!-- 显示time图标 -->
  18. <span class="glyphicon glyphicon-time"></span>
  19. <!-- 展示倒计时 -->
  20. <span class="glyphicon" id="seckill-box"></span>
  21. </h2>
  22. </div>
  23. </div>
  24. </div>
  25. <!-- 登陆弹出层,输入电话 -->
  26. <div id="killPhoneModal" class="modal fade">
  27. <div class="modal-dialog">
  28. <div class="modal-content">
  29. <div class="modal-header">
  30. <h3 class="modal-title text-center">
  31. <span class="glyphicon glyphicon-phone"></span>秒杀电话:
  32. </h3>
  33. </div>
  34. <div class="modal-body">
  35. <div class="row">
  36. <div class="col-xs-8 col-xs-offset-2">
  37. <input type="text" name="killPhone" id="killPhoneKey"
  38. placeholder="填手机号^o^" class="form-control"/>
  39. </div>
  40. </div>
  41. </div>
  42. <div class="modal-footer">
  43. <!-- 验证信息 -->
  44. <span id="killPhoneMessage" class="glyphicon"></span>
  45. <button type="button" id="killPhoneBtn" class="btn btn-success">
  46. <span class="glyphicon glyphicon-phone"></span>
  47. Submit
  48. </button>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </body>
  54. <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
  55. <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
  56.  
  57. <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
  58. <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  59. <!-- 使用cdn获取公共js http://www.bootcdn.cn -->
  60. <!-- jQuery cookie操作插件 -->
  61. <script src="http://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
  62. <!-- jQuery countDown倒计时插件 -->
  63. <script src="http://cdn.bootcss.com/jquery.countdown/2.2.0/jquery.countdown.min.js"></script>
  64. <!-- 开始编写交互逻辑 -->
  65. <script src="/MySeckill/resources/script/seckill.js" type="text/javascript"></script>
  66. <script type="text/javascript">
  67. $(function(){
  68. //使用EL表达式传入参数
  69. seckill.detail.init({
  70. 'seckillId' : '${seckill.seckillId}',
  71. 'startTime' : '${seckill.startTime.time}',//毫秒
  72. 'endTime' : '${seckill.endTime.time}'
  73.  
  74. });
  75. });
  76. </script>
  77. </html>

3:在WebRoot下新建一个文件夹resources,用于存放一些共用的资源,如js、images等。

resource下新建一个文件夹script,新建一个js文件 seckill.js,用于书写交互函数:

  1. //存放主要交互逻辑js代码
  2. //javascript模块化.json类型
  3. var seckill={
  4. //封装秒杀相关ajax的url
  5. URL:{
  6. now : function(){
  7. return "seckill/time/now";
  8. },
  9. exposer : function(seckillId){
  10. return 'seckill/'+seckillId+'/exposer';
  11. },
  12. execution : function(seckillId,md5){
  13. return 'seckill/'+seckillId+'/'+md5+'/execution';
  14. }
  15. },
  16. handlerSeckill:function(seckillId, node){
  17. //获取秒杀地址,控制显示逻辑 执行秒杀
  18. node.hide().html('<button class="btn btn-primary btn-lg" id="killBtn">开始秒杀</button>');
  19. $.post(seckill.URL.exposer(seckillId),{},function(result){
  20. //在回调函数中执行交互流程
  21. if(result && result['success']){
  22. var exposer = result['data'];
  23. if(exposer['exposed']){
  24. //开启秒杀
  25. var md5 = exposer['md5'];
  26. var killUrl = seckill.URL.execution(seckillId,md5);
  27. console.log("killUrl:"+killUrl);
  28. //绑定一次点击事件
  29. $('#killBtn').one('click',function(){
  30. //执行秒杀请求的操作
  31. //1.先禁用按钮
  32. $(this).addClass('disabled');
  33. //2.发送秒杀请求
  34. $.post(killUrl,{},function(result){
  35. if(result && result['success']){
  36. var killResult = result['data'];
  37. var state = killResult['state'];
  38. var stateInfo = killResult['stateInfo'];
  39. //3.显示秒杀结果
  40. node.html('<span class="label label-success">'+stateInfo+'</span>');
  41. }
  42. });
  43. });
  44. node.show();
  45. }else{
  46. //未开始秒杀
  47. var now = exposer['now'];
  48. var start = exposer['start'];
  49. var end = exposer['end'];
  50. //重新计算计时逻辑
  51. seckill.countdown(seckillId,now,start,end);
  52. }
  53. }else{
  54. console.log('result:'+result);
  55. }
  56. });
  57. },
  58. //验证手机号
  59. validatePhone:function(phone){
  60. if(phone && phone.length==11 && !isNaN(phone)){//isNaN不是数字
  61. return true;
  62. } else {
  63. return false;
  64. }
  65. },
  66. countdown:function(seckillId, nowTime, startTime, endTime){
  67. var seckillBox = $('#seckill-box');
  68. if(nowTime > endTime){
  69. seckillBox.html('秒杀结束!');
  70. } else if(nowTime < startTime){
  71. //秒杀未开始,倒计时
  72. var killTime = new Date(startTime-0 + 1000);
  73. seckillBox.countdown(killTime,function(event){
  74. //时间格式
  75. var format = event.strftime('秒杀倒计时: %D天 %H时 %M分 %S秒');
  76. seckillBox.html(format);
  77. /*时间完成后回调函数*/
  78. }).on('finish.countdown',function(){
  79. //获取秒杀地址,控制显示逻辑 执行秒杀
  80. seckill.handlerSeckill(seckillId, seckillBox);
  81. });
  82. }else{
  83. //秒杀开始
  84. seckill.handlerSeckill(seckillId, seckillBox);
  85. }
  86. },
  87. //详情页秒杀逻辑
  88. detail:{
  89. //详情页初始化
  90. init : function(params){
  91. //用户手机验证和登陆,计时交互
  92. //在cookie中查找手机号
  93. var killPhone = $.cookie('killPhone');
  94. var startTime = params['startTime'];
  95. var endTime = params['endTime'];
  96. var seckillId = params['seckillId'];
  97. //验证手机号
  98. if(!seckill.validatePhone(killPhone)){
  99. //绑定phone
  100. var killPhoneModal = $('#killPhoneModal');
  101. killPhoneModal.modal({
  102. show:true,//显示弹出层
  103. backdrop:'static',//禁止位置关闭
  104. keyboard:false//关闭键盘事件
  105. });
  106. $('#killPhoneBtn').click(function(){
  107. var inputPhone = $('#killPhoneKey').val();
  108. if(seckill.validatePhone(inputPhone)){
  109. //电话写入cookie
  110. $.cookie('killPhone',inputPhone,{expires:7,path:'/seckill'});
  111. //刷新页面
  112. window.location.reload();
  113. } else {
  114. $('#killPhoneMessage').hide().html('<label class="label label-danger">手机号错误!</label>').show(300);
  115. }
  116. });
  117. }
  118. //已经登陆
  119. //计时交互
  120. $.get(seckill.URL.now(),{},function(result){
  121. if(result && result['success']){
  122. var nowTime = result['data'];
  123. seckill.countdown(seckillId, nowTime, startTime, endTime);
  124. } else {
  125. console.log('result:'+result);
  126. }
  127. });
  128. }
  129. }
  130. }

4:部署测试记录

提示DispatcherServlet找不到,或者配置文件找不到,首先检查部署到tomcat的目录下有无对应文件。

如果没有,则检查是否Myeclipse中的关于项目编译文件输出目录与部署文件拉取目录不一致导致出错。

一般,Maven项目都会把项目编译文件输出到target目录下,而我们需要的是WebRoot/WEB-INF/classes目录,所以需要修改。

1)右键项目,Buildpath——configer buildPath

2)选择 source 选项卡

3)修改output folder:

4)左侧,打开部署选项配置

5)修改拉取路径

SSM实战——秒杀系统之Web层Restful url设计、SpringMVC整合、页面设计的更多相关文章

  1. SSM实战——秒杀系统之Service层接口设计与实现、Spring托管、声明式事务

    一:Service层接口设计 准备工作:新建三个包:service包.exception包.dto包,分别用来存放业务接口.自定义异常类.dto类. 1:定义接口 package org.myseck ...

  2. SSM实战——秒杀系统之DAO层实体定义、接口设计、mybatis映射文件编写、整合Spring与Mybatis

    一:DAO实体编码 1:首先,在src目录下,新建org.myseckill.entity包,用于存放实体类: 2:实体类设计 根据前面创建的数据库表以及映射关系,创建实体类. 表一:秒杀商品表 对应 ...

  3. SSM实战——秒杀系统之创建项目、管理依赖、设计数据库

    注:本项目使用Myeclipse开发. 一:项目创建 1:使用Myeclipse创建一个web project,命名为MySeckill,并转换为Maven项目. 2:创建项目文件目录如下: 上面四个 ...

  4. SSM实战——秒杀系统前言

    项目来源:慕课网http://www.imooc.com/u/2145618/courses?sort=publish 项目开发流程:整合SSM框架——项目需求分析与实现——解决高并发优化 所用技术: ...

  5. SSM实战——秒杀系统之高并发优化

    一:高并发点 高并发出现在秒杀详情页,主要可能出现高并发问题的地方有:秒杀地址暴露.执行秒杀操作. 二:静态资源访问(页面)优化——CDN CDN,内容分发网络.我们把静态的资源(html/css/j ...

  6. 03 整合IDEA+Maven+SSM框架的高并发的商品秒杀项目之web层

    Github:https://github.com/nnngu 项目源代码:https://github.com/nnngu/nguSeckill 前端交互流程设计 对于一个系统,需要产品经理.前端工 ...

  7. SSM实现秒杀系统案例

    ---------------------------------------------------------------------------------------------[版权申明:本 ...

  8. Java高并发秒杀API之web层

    第1章 设计Restful接口 1.1前端交互流程设计 1.2 学习Restful接口设计 什么是Restful?它就是一种优雅的URI表述方式,用来设计我们资源的访问URL.通过这个URL的设计,我 ...

  9. SSM之秒杀系统

    利用idea搭建SSM框架,主要利用Maven仓库下载相应的jar包,以下是相关的pom.xml <project xmlns="http://maven.apache.org/POM ...

随机推荐

  1. ios之CABasicAnimation

    博主:最近iOS开发中用到CoreAnimation的framework来做动画效果,虽然以前也用过,但一直没有系统学习过,今天看到一篇非常详细的博文(虽然是日语,但真的写的很好),在此翻译出来供大家 ...

  2. Orchard模块开发全接触2:新建 ProductPart

    一:创建 Part 1:项目引用 Orchard.Framework: 2:创建 Models 文件夹: 3:在 Models 文件夹下创建类 ProductPartRecord,如下: public ...

  3. ImportError: No module named model_libs

    在运行ssd时遇到这个问题 实际是python接口的路径不对,使用echo $$PYTHONPATH  弹出当前python路径,发现是caffe自己的python接口,采用 export PYTHO ...

  4. 【转】windows下mongodb安装与使用整理

    转自 :http://www.cnblogs.com/lecaf/archive/2013/08/23/mongodb.html 一.首先安装mongodb 1.下载地址:http://www.mon ...

  5. 【Android归纳】开发中应该注意的事项

    1.子线程中不能更新界面,更新界面必须在主线程中进行 2.Fragment注意的事项: a)  Activity调用Fragment中的方法 b)  Thread或者Handler调用Fragment ...

  6. JAVA 是否会发生内存泄露(转)

    原文链接: JAVA 是否会发生内存泄露 几次面试,面试官都问到了这个问题,于是搜集了答案.总结出虽然java自身有垃圾回收机制,但是很多情况下还是发生内存泄露的. java导致内存泄露的原因很明确: ...

  7. ASP.NET MVC:WebPageRenderingBase.cs

    ylbtech-funcation-Utility: ASP.NET MVC:WebPageRenderingBase.cs 提供用于呈现使用 Razor 视图引擎的页的方法和属性. 1.A,WebP ...

  8. pytorch之dataloader深入剖析

    PyTorch学习笔记(6)——DataLoader源代码剖析 - dataloader本质是一个可迭代对象,使用iter()访问,不能使用next()访问: - 使用iter(dataloader) ...

  9. AOP AspectJ 字节码 语法 MD

    Markdown版本笔记 我的GitHub首页 我的博客 我的微信 我的邮箱 MyAndroidBlogs baiqiantao baiqiantao bqt20094 baiqiantao@sina ...

  10. js时间戳怎么转成日期格式

    原文地址:http://www.sufeinet.com/thread-1500-1-1.html js时间戳怎么转成日期格式这个在主群里有朋友§☆釺哖蟲...o问js时间戳怎么转成日期格式 ,他的问 ...