当前位置:网站首页>中国赛宝的面经
中国赛宝的面经
2022-06-10 10:54:00 【csx_zzh】
介绍一下SpringMVC的基本工作流程?

(1)客户端通过url发送请求
(2-3)核心控制器Dispatcher Servlet接收到请求,通过系统或自定义的映射器配置找到对应的handler,并将url映射的控制器controller返回给核心控制器。
(4)通过核心控制器找到系统或默认的适配器
(5-7)由找到的适配器,调用实现对应接口的处理器,并将结果返回给适配器,结果中包含数据模型和视图对象,再由适配器返回给核心控制器
(8-9)核心控制器将获取的数据和视图结合的对象传递给视图解析器,获取解析得到的结果,并由视图解析器响应给核心控制器
(10)核心控制器将结果返回给客户端
线程有几种状态?在Java中创建线程有哪几种方式?
1.、新建(NEW):新创建了一个线程对象。
2.、可运行(RUNNABLE):线程对象创建后,其他线程(比如main线程)调用了该对象
的start()方法。该状态的线程位于可运行线程池中,等待被线程调度选中,获取cpu 的
使用权 。
3.、运行(RUNNING):可运行状态(runnable)的线程获得了cpu 时间片(timeslice)
,执行程序代码。
4.、阻塞(BLOCKED):阻塞状态是指线程因为某种原因放弃了cpu 使用权,也即让出
了cpu timeslice,暂时停止运行。直到线程进入可运行(runnable)状态,才有机会再
次获得cpu timeslice 转到运行(running)状态。阻塞的情况分三种:
(一). 等待阻塞:运行(running)的线程执行o.wait()方法,JVM会把该线程放入等待队
列(waitting queue)中。
(二). 同步阻塞:运行(running)的线程在获取对象的同步锁时,若该同步锁被别的线程
占用,则JVM会把该线程放入锁池(lock pool)中。
(三). 其他阻塞:运行(running)的线程执行Thread.sleep(long ms)或t.join()方法,或
者发出了I/O请求时,JVM会把该线程置为阻塞状态。当sleep()状态超时、join()等待
线程终止或者超时、或者I/O处理完毕时,线程重新转入可运行(runnable)状态。
5.、死亡(DEAD):线程run()、main() 方法执行结束,或者因异常退出了run()方法,
则该线程结束生命周期。死亡的线程不可再次复生。

线程的创建方式:
1)继承Thread类,实现run()方法;
2)实现Runnable接口,并创建Thread类的实例,同样实现run()方法,没有返回值;
3)实现Callable接口,创建Callable接口的实现类,并实现call()方法,有返回值;
4)使用线程池创建线程;(注意:可以去自己去查看线程池的创建方式,线程池的参数有
什么特点)
边栏推荐
- Google Earth Engine(GEE)——国家标识符网格数据集
- 数商云家具行业供应商评估管理系统:提升家具企业核心竞争力,实现数字化协同管理
- Carbon reduction in the construction industry is by no means a fresh idea experts suggest strengthening the transformation of rural buildings
- 数商云商业服务业SaaS管理系统:实现高效业务协作,助力企业完善数字化转型之路
- 基于分布式数据库本身的定时备份方法
- golang线程安全的本地map -- gocache
- PV操作每日一题-橘子苹果问题(进阶版)
- Open source byte design idea
- Uniapp implements authorized login
- Mixin -- mixed
猜你喜欢

MySQL architecture

No subnet partition? Rego will help you understand IP addresses and teach you how to divide subnets!

在线文档协作工具,是提高工作效率的第一步

cocoslua在vs2013的调试方法

Analysis: a stable currency is not a "stable currency", but a product in essence

保温热水更方便,日常泡奶的小神器,七彩叮当无线便携式调奶器上手

Carbon reduction in the construction industry is by no means a fresh idea experts suggest strengthening the transformation of rural buildings

Debugging method of cocoslua in vs2013

How to state clearly and concisely the product requirements?

NeRF:用深度学习完成3D渲染任务的蹿红
随机推荐
Stock to maximize profits
Leetcode 1991. Find the middle position of the array (brute force enumeration)
高考志愿填报,城市、学校与专业怎么选?
AttributeError: module ‘gym.envs.box2d‘ has no attribute ‘LunarLander‘ 解决办法
中台:数据中台、业务中台、技术中台、应用中台、AI中台……
Extract e-mail from POP3 server
数商云通讯行业数字化供应链协同系统:赋能通讯企业改善供应业务,增强市场竞争力
PV operation daily question - buffer problem (advanced version)
PV operation daily question - orange apple question (advanced version)
钰泰半导体冲刺科创板:年营收8.3亿 实控人为美国籍
Northrop Grumman has passed the registration: the annual revenue is 600million, and Wu Jie, the actual controller, is an American
【C语言】#pragma pack(1) 和#pragma pack()
Binary find a specific value in an ordered array
C 12 循环队列Circular queue
Music retrieval system based on SSH
Common shell commands - 02 compression and decompression
fcpx插件:PremiumVFX Animation Presets(动画循环预设) v1.0.1特别版
More durable game real wireless headset with large battery and long endurance. Hero G1 can use it
C#大作业——学生信息管理系统
Splishsplash架构介绍