tomcat
自驱
ALOHA HEJA HE
展开
-
JSON parse error: Unexpected character (‘%‘ (code 37)): expected a valid value (number, String, arr
1 复现过程 POST + @RequestBody +json格式的数据,不指定数据格式MappingJackson2HttpMessageConverter 读取 application/x-www-form-urlencoded;charset=UTF-8 就会报异常:JSON parse error: Unexpected character ('%' (code 37)): expected a valid value (number, String, array, object, 'tr..原创 2020-11-22 14:38:12 · 15813 阅读 · 0 评论 -
【arthas】 分析java web程序利器
1 下载curl -O https://alibaba.github.io/arthas/arthas-boot.jarjava -jar arthas-boot.jardashboard2 dashboard 命令上面是先通过观察总体的线程信息,然后查看具体的线程运行情况。如果只是为了寻找 CPU 使用较高的线程,可以直接使用命令 thread -n [显示的线程个数...原创 2020-03-29 16:38:00 · 252 阅读 · 0 评论 -
tomcat责任链模式中pipline 和 valve 是做什么的?
1 先看结构图实际上 Pipeline 和 Valve 是扩展了这个链的功能,使得在链往下传递过程中,能够接受外界的干预。Pipeline 就是连接每个子容器的管子,里面传递的 Request 和 Response 对象好比管子里流的水,而 Valve 就是这个管子上开的一个个小口子,让你有机会能够接触到里面的水,做一些额外的事情。为了防止水被引出来而不能流到下一个容器中,每一段管子最...原创 2020-03-19 09:06:17 · 439 阅读 · 0 评论 -
知识库--StandardContext(57)
StandardContext (tomcat 4 and 5)历史 A context represents a web application and contains one or more wrappers, each of which represents a servlet definition. However, a context requires other components翻译 2016-12-21 08:36:22 · 338 阅读 · 0 评论 -
知识库--ApplicationFilterChain(54)
ApplicationFilterChainThe org.apache.catalina.core.ApplicationFilterChain class is the implemetation of the javax.servlet.FilterChain interface. The invoke method in the StandardWrapperValve class crea翻译 2016-12-18 23:33:45 · 1014 阅读 · 0 评论 -
知识库--StandardContext+backgroundProcess(60)
The backgroundProcess MethodA context needs the help of other components, such as a loader and a manager. Often these components require a separate thread that handles background processing. For in翻译 2016-12-25 16:01:20 · 639 阅读 · 0 评论 -
知识库--Server + Service(61)
Server and ServiceOverview In previous chapters you have seen how you can have a servlet container by instantiating a connector and container and then associating them with each other. Only one conne翻译 2016-12-26 08:28:57 · 379 阅读 · 0 评论 -
知识库--ZooKeeper create Session (61)
ZooKeeper create Session zk安装步骤: 1 wget http://zookeeper.apache.org –>具体的版本 2 extract the distribution: # tar -xvzf zookeeper-3.4.5.tar.gz --need java63 change directory(cd) to the project’翻译 2016-12-27 00:00:14 · 595 阅读 · 0 评论 -
知识库--tomcat+StandardService
StandardServerThe org.apache.catalina.core.StandardServer class is the standard implementation of Server. We’re particularly interested in the shutdown mechanism offered by this class, which is also th翻译 2016-12-28 00:12:18 · 466 阅读 · 0 评论 -
知识库--tomcat+service(63)
Service The org.apache.catalina.service interface represents a service. public interface Service{ public Container getContainer(); public void setContainer(Container container);翻译 2016-12-28 08:43:12 · 291 阅读 · 0 评论 -
知识库--StandardService+Container+Connectors(64)
Container and ConnectorsA StandardService instance contains two types of components: a container and one or more connectors. Being able to have multiple connectors enable Tomcat to service multiple pro翻译 2016-12-29 08:44:00 · 367 阅读 · 0 评论 -
知识库--Engine interface(56)
Engine InterfaceThe org.apache.catalina.Engine interface represents an engine. An engine represents the entire Catalina servlet engine. You would want to use an engine if you want to support multip翻译 2016-12-20 22:09:32 · 628 阅读 · 0 评论 -
知识库--ApplicationFilterConfig+FilterConfig实践(54)
ApplicationFilterConfigThe org.apache.catalina.core.ApplicationFilterConfig implements the javax.servlet.FilterConfig interface. ApplicationFilterConfig manages the filter instances that are created wh原创 2016-12-18 23:14:43 · 1882 阅读 · 0 评论 -
知识库--StandardContext + Reloading(60)
Support for ReloadingThe StandardContext class defines the reloadable property to indicate whether reloading of the application is enabled. When reloading is enabled, the application will be reloaded翻译 2016-12-25 12:29:09 · 397 阅读 · 0 评论 -
知识库--StandardContextMapper(60)
StandardContextMapper//StandardContextValve首先获取wrapper For each incoming request, the invoke method of the StandardContext’s pipeline’s basic valve will be called. The basic valve for a StandardContex翻译 2016-12-25 10:54:05 · 446 阅读 · 0 评论 -
知识库--how+request+invoke+servlet(53)
Sequence of Methods InvocationFor each incoming HTTP request, the connector calls the invoke method of the associated container. The container will then call the invoke methods of all its child contain翻译 2016-12-17 21:28:43 · 365 阅读 · 0 评论 -
知识库--SingleThreadModel STM(53)
SingleThreadModel(STM)Understanding this interface is crucial in understanding how a wrapper loads a servlet.According to the Servlet specification, the purpose of implementing this interface is to gur翻译 2016-12-17 22:10:21 · 377 阅读 · 0 评论 -
知识库 --allocate the servlet(54)
Allocating the ServletThe StandardWrapperValve’s invoke method calls the wrapper’s allocate method to obtain an instance of the requested servlet. The StandardWrapper class therefore must have the翻译 2016-12-18 12:05:31 · 349 阅读 · 0 评论 -
知识库--Loading+Servlet(54)
Loading the ServletThe StandardWrapper class implements the load method of the Wrapper interface. The load method calls the loadServlet method that loads the servlet and calls its init me翻译 2016-12-18 13:59:48 · 347 阅读 · 0 评论 -
知识库--StandardService + Lifecycle(start/stop)+initialize(72)
StandardService + Lifecycle(start/stop)+initializeThe lifecycle methods are the start and the stop methods inherited from the Lifecycle interface plus the initialize method.//initialize method calls th翻译 2017-01-04 00:31:20 · 313 阅读 · 0 评论 -
知识库--ServletConfig Object(54)
The loadServlet method of the StandardWrapper class calls the sender’s init method after the servlet is loaded. The init method is passed an instance of javax.servlet.ServletConfig. You may be wonderi翻译 2016-12-18 21:03:56 · 396 阅读 · 0 评论 -
知识库--StandardWrapperFacade(54)
StandardWrapperFacadeThe StandardWrapper instance calls the init method of the servlet it loads. The init method requires a javax.servlet.ServletConfig and then StandardWrapper class itself implements翻译 2016-12-18 21:45:03 · 425 阅读 · 0 评论 -
知识库--StandardWrapperValve(54)
StandardWrapperValveThe StandardWrapperValve class is the basic valve in a StandardWrapper instance.This valve does two thinds:1 Executes all filters associated with the servlet2 Calls the sender's se翻译 2016-12-18 22:28:18 · 382 阅读 · 0 评论 -
知识库--web.xml 中的 FilterDef(54)
FilterDefThe org.apache.catalina.deploy.FilterDef class represents a filter definition as defined by the filter element in the deployment descriptor. public final class FilterDef{ p翻译 2016-12-18 22:47:27 · 347 阅读 · 0 评论 -
面试--Tomcat+一个请求的完整过程(76)
Tomcat处理一个HTTP请求的过程 假设来自客户的请求为: http://localhost:8080/yy/index.jsp 1) 请求被发送到本机端口8080,被在那里侦听的Coyote HTTP/1.1 Connector获得 2) Connector把该请求交给它所在的Service的Engine来处理,并等待来自Engine的回应 3) Engine获得请求localh原创 2017-01-11 00:37:30 · 5272 阅读 · 0 评论 -
知识库--Tomcat+Shutdown+Hook(76)
In a Tmocat deployment you start the servlet container by instantiating a Server object and call its start method, which in turn calls the start method of other components. In a normal situation, to gi翻译 2017-01-11 08:36:47 · 372 阅读 · 0 评论 -
知识库--Tomcat deployment must + Host(56)
Tomcat deployment must + HostA Tomcat deployment must have a host if each context is to be configured using ContextConfig. The reason is following.ContextConfig needs the location of the application we翻译 2016-12-20 10:02:17 · 427 阅读 · 0 评论 -
【技术】一个字符使得页面崩了 特殊字符的统一处理 springBoot 统一处理请求参数(/u2028) 完整demo
1 目的 统一处理请求参数 GET POST JSON / form2 解决方案: 获取请求的参数,扩展HttpServletRequestWrapper类,装饰器模式和包装器模式;【【【wrapper 一个新的请求出来/副本】】】3 实例如下/** * Request请求参数获取处理类 * * form and json * */public clas...原创 2019-05-16 00:02:33 · 3038 阅读 · 3 评论 -
【历史】最原始、最本质的 Server-side Database Query Servlet
项目结构 webapps 目录下.//hello.//hello/index.html.//hello/WEB-INF.//hello/WEB-INF/.DS_Store.//hello/WEB-INF/classes.//hello/WEB-INF/classes/HelloServlet.class.//hello/WEB-INF/classes/HelloServlet.jav...原创 2019-05-12 09:06:57 · 238 阅读 · 0 评论 -
【历史】 tomcat mysql server 端本地部署完美方案
1 介绍HTTP Server: E.g., Apache HTTP Server, Apache Tomcat Server, Microsoft Internet Information Server (IIS), nginx, Google Web Server (GWS), and others. HTTP Client (or Web Browser): E.g., Interne...原创 2019-05-12 09:17:19 · 1398 阅读 · 0 评论 -
【https】 1 HTTP Security (bb102-1)
A secure system shall provide the following assurances:安全系统应提供以下保证:Authentication:"The person is who he says he is."This is usually carried out via "username and password".Other techniques in...翻译 2019-06-01 14:56:05 · 3059 阅读 · 0 评论 -
【https】2 Introduction to SSL/TLS (bb102-1)
Secure Socket Layer(SSL), also known asTransfer Layer Security(TLS), is a security protocol that implements three cryptographic assurances: user authentication(认证), message confidentiality and mess...原创 2019-06-01 15:07:08 · 297 阅读 · 0 评论 -
【https】3 Introduction to SSL/TLS 数字证书产生原因(bb102-1)
1 To understand SSL, you need some basic cryptographic knowledge of public key, secret key, message digest, and digital certificate.The above illustration shows the process of encryption and...原创 2019-06-01 16:27:15 · 246 阅读 · 0 评论 -
【https】4 How SSL Works(bb102-1)
1 How SSL WorksThere are two phases in a SSL session: handshaking and data transfer. The handshaking must be completed before data transfer can take place in a secure manner. The handshaking involv...原创 2019-06-01 16:31:40 · 384 阅读 · 0 评论 -
【https】5 A SSL Session Trace (bb102-1)
SSL Session TraceWe could use OpenSSL'ss_client(with debug option) to produce a SSL session trace.> openssl s_client ?(Display the available options)The following command turns on the ...原创 2019-06-01 16:31:49 · 1896 阅读 · 0 评论 -
【java进程内存】大小计算
背景: 在阿里云一个ECS机器上(4核16G)部署一个应用;运行时查看进程占用内存为12g! PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND18650 root 30 10 17.699g 0.012t 19452 S 7.3 78.8 13:04.42 java...原创 2019-07-28 20:25:47 · 1415 阅读 · 0 评论 -
【redis】 大key解决方案第二步
方案:对于量少的大key 可以考虑本地cache protected Cache<String, Set<String>> habitMemberCache = CacheBuilder.newBuilder().maximumSize(2000L).expireAfterWrite(1800L, TimeUnit.SECONDS).build();...原创 2019-05-07 17:18:41 · 610 阅读 · 0 评论 -
【知识库】catalina.home 和 catalina.base 怎么寻找?定义?做什么用的? tomcat
1 查找:linux 系统 通过两个命令:jcmd 找到pidjinfo pid | grep catalina例如:2 定义:catalina.base : 项目的工作目录Name of the system property containing the tomcat instance installation path;catalina.home: 公用库目...原创 2019-05-06 14:48:42 · 1771 阅读 · 1 评论 -
Redis使用FastJson序列化/FastJson2JsonRedisSerializer --坑
很多小伙伴序列化代码是这样配置的public class FastJson2JsonRedisSerializer<T> implements RedisSerializer<T> { public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8"); private Cl...原创 2019-01-19 23:14:46 · 14451 阅读 · 0 评论 -
你可能猜不到!springboot http请求拦截器Intercepter处理发生异常时会发生什么?500? 404?
图1 DispatchServlet 继承关系图2一次http请求经过的处理类 tomcat ---coyote---catalina---springframework图3 一次http请求经过的处理类 tomcat ---coyote---catalina---springframework图4 catalina 中经过的Filter 调用链 Applicatio...原创 2019-04-20 22:30:04 · 5028 阅读 · 0 评论