response

easyexcel使用

女生的网名这么多〃 提交于 2020-01-25 01:15:37
一、easyexcel介绍 Java解析、生成Excel比较有名的框架有Apache poi、jxl。但他们都存在一个严重的问题就是非常的耗内存,poi有一套SAX模式的API可以一定程度的解决一些内存溢出的问题,但POI还是有一些缺陷,比如07版Excel解压缩以及解压后存储都是在内存中完成的,内存消耗依然很大。easyexcel重写了poi对07版Excel的解析,能够原本一个3M的excel用POI sax依然需要100M左右内存降低到几M,并且再大的excel不会出现内存溢出,03版依赖POI的sax模式。在上层做了模型转换的封装,让使用者更加简单方便。 easyexcel github地址 二、easyexcel使用 1、excel导出 通过注解设置字段属性 @Data public class Person { @ExcelProperty(value = {"人员信息", "姓名"}, index = 0, converter = AutoConverter.class) private String name; @ExcelProperty(value = {"人员信息","年龄"}, index = 1) private int age; @ExcelProperty(value = {"人员信息","性别"}, index = 2) private int

12306自动刷票下单-登录篇

眉间皱痕 提交于 2020-01-24 20:27:05
12306网站推出图片验证码以后,对于抢票软件就提出了更高的要求,本篇并不涉及自动识别验证码登录(主要是博主能力所限),提供一个途径- 打码平台 ,这个几乎是可以破解所有验证码了,本篇主要是分享一下12306网站登录的流程的学习,勿吐槽,有问题请指正,博主也是刚开始接触爬虫,大家共勉共勉。 废话不多说了,直接干吧 首先打开12306登录页面https://kyfw.12306.cn/otn/login/init 输入账号密码直接登录,会转入到下面的页面https://kyfw.12306.cn/otn/index/initMy12306 红线划掉的就是用户名,那么我们最终就是要访问这个网页查找到我们的用户名,简单吧 好了,不闹了,看一下我们整个登录过程中的请求吧 这里缺少了打开登录页面的请求,如果你没有发现,那我刚说了你就应该发现,这个登录页面是必须的,这里说一下我的理解,登录过程中我们是要发送验证码的,验证码作为独立的请求发送,那么服务器是要知道这个验证码是由张三发过来的还是由李四发过来的,所以当我们打开登录页面的时候,服务器会记录session或者cookie,我们之后的请求都通过携带cookie让服务器知道是我张三发送的请求,而不是李四。大概就是这么回事,可能说的不太对,我也就理解了这么点,见谅见谅。 这里我们使用requests库,不要太方便 import requests

请做一个Filter过滤器的hello world最简单的一个例子

旧时模样 提交于 2020-01-24 20:07:08
1)helloWorld: 请同学们先做本部分的Filter的hello world实验。之后根据实验,再返回来学习我接下来的这段话。由于在web.xml当中,我们Filter的url-pattern是/*,所以当用户 访问根目录下的任何目标文件时,我们这个Filter都会起作用。当发现用户要访问home.jsp时,MarkToWinFilter中的 doFilter方法会被运行。其中"之前 filterChain.doFilter"不出意外的会被打印出来。马克-to-win:接着就是chain.doFilter(request, response);方法。chain是什么?看那张说明“Filter的拦截的工作过程”的图了吗?那里面的1234567,7个步骤点,你不觉得就像 一个chain(链儿)吗?所以chain.doFilter(request, response);的意思就是顺着链,继续往下走一步,就一步而已,继续执行。如果还是Filter,就还是执行 chain.doFilter,如果是Servlet,就执行doXXX方法。Servlet执行完以后,别忘了,还要回来执行doFilter中的 chain.doFilter后面的部分。请大家仔细观察实验执行结果。 例 1.2.1 home.jsp: <%@ page contentType="text/html; charset

NodeJS require路径

半世苍凉 提交于 2020-01-24 14:36:52
项目需要用nodejs,感觉nodejs是前端装逼神器了,是通向全栈工程师的必经之路哇,接下来开始踏上学习nodejs的征程。下面是第一个hello,world的程序。 1、server.js文件,这相当于服务器脚本。 var http = require("http"); function start() { function onRequest(request, response) { console.log("Request recieved") response.writeHead(200, { "Content-Type": "text/plain" }); response.write("hello,world"); response.end(); } http.createServer(onRequest).listen(8888); } exports.start=start; 这是最简单的一个模块,http是nodejs自带的模块,start是自己定义的一个模块。 2、index.js。这是执行文件,注意require的路径。 var server=require("./module/server"); server.start(); 在项目目录下用node运行node index.js,然后在浏览器中输入:http://localhost

spring integration : response message not sent to client from error-channel

旧城冷巷雨未停 提交于 2020-01-24 13:03:52
问题 I've the understanding that Spring Integration (SI) will wrap any exception (under the SI domain) to a MessageException instance and place it on the "error-channel". Following are few snippets from my spring config file : <int:channel-interceptor pattern="ersServiceReqRcvPostValidationChannel,ersServiceResRcvPostValidationChannel" order="1"> <bean class="com.bnym.ecs.report.service.orchestration.interceptors.MsgJSONSyntaxValidationInterceptor"/> </int:channel-interceptor> <int:channel

spring integration : response message not sent to client from error-channel

不想你离开。 提交于 2020-01-24 13:03:11
问题 I've the understanding that Spring Integration (SI) will wrap any exception (under the SI domain) to a MessageException instance and place it on the "error-channel". Following are few snippets from my spring config file : <int:channel-interceptor pattern="ersServiceReqRcvPostValidationChannel,ersServiceResRcvPostValidationChannel" order="1"> <bean class="com.bnym.ecs.report.service.orchestration.interceptors.MsgJSONSyntaxValidationInterceptor"/> </int:channel-interceptor> <int:channel

spring integration : response message not sent to client from error-channel

此生再无相见时 提交于 2020-01-24 13:03:05
问题 I've the understanding that Spring Integration (SI) will wrap any exception (under the SI domain) to a MessageException instance and place it on the "error-channel". Following are few snippets from my spring config file : <int:channel-interceptor pattern="ersServiceReqRcvPostValidationChannel,ersServiceResRcvPostValidationChannel" order="1"> <bean class="com.bnym.ecs.report.service.orchestration.interceptors.MsgJSONSyntaxValidationInterceptor"/> </int:channel-interceptor> <int:channel

AJAX response time

谁说胖子不能爱 提交于 2020-01-24 12:11:34
问题 How I can calculate AJAX response time? I need this in script, because I get back the server timestamp, but if the request take more than 1 second I need to add 1 second to the timestamp! 回答1: You need to get the start time (just before the AJAX request is done), and then the end time when the script is complete. You can than work out the difference, and if it's greater than 60 seconds, do your thing. //Before the AJAX function runs var startTime = new Date().getTime(); //Place this code

django框架--底层架构

佐手、 提交于 2020-01-24 08:32:00
目录 零、参考 一、对于web服务的理解 二、对于wsgi协议的理解 三、自定义一个简单的基于wsgi协议的web框架 四、django中的server实现 五、django中的application实现 六、django的底层调用链 七、总结 零、参考 https://www.jianshu.com/p/679dee0a4193 https://www.letiantian.me/2015-09-10-understand-python-wsgi/ 一、对于web服务的理解 web 服务应该至少包含两个模块: web 服务器和 web 应用程序,两个模块在功能和代码上解耦。 web 服务器负责处理 socket 调用、 http 数据解析和封装等底层操作。 web 应用程序负责业务处理、数据增删改查、页面渲染/生成等高层操作。 web 服务器一旦接收到 http 请求,经过自身的解析后就会调用 web 应用程序来处理业务逻辑,并得到 web 应用程序的返回值,再经过自身的封装发送给客户端。 二、对于wsgi协议的理解 在 web 服务器和 web 应用程序之间需要定义一个接口规则,这也叫协议,用于明确两者之间以什么样的形式交互数据。即: web 服务器应该以什么样的形式调用web应用程序,而 web 应用程序又应该定义成什么形式。 python 下规定的 web

使用httpclient发送get或post请求

隐身守侯 提交于 2020-01-24 07:47:22
HttpClient 是 Apache Jakarta Common 下的子项目,可以用来提供高效的、最新的、功能丰富的支持 HTTP 协议的客户端编程工具包,并且它支持 HTTP 协议最新的版本和建议。当前官网最新版介绍页是: http://hc.apache.org/httpcomponents-client-4.5.x/index.html 许多模拟http请求的框架都用httpclient,测试人员可通过它模拟请求http协议接口,做接口自动化测试。 1、包下载: 地址: http://mvnrepository.com/ <!-- maven依赖 --> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.2</version> </dependency> 发送get请求 1、通过请求参数url和头文件cookie作为参数(cookie可以为空)发送get请求,读取返回内容 代码如下: public static String httpGet(String url,String cookie) throws Exception{ String result=""; //返回信息 //创建一个httpGet请求