集合
![ff9cfd1e8f7e8b387163306a31c2fa6a.png](https://img-blog.csdnimg.cn/img_convert/ff9cfd1e8f7e8b387163306a31c2fa6a.png)
186.Java集合体系结构List,Set,Collection,Map区别
![d12f9610d04226ad9323461419b33d84.png](https://img-blog.csdnimg.cn/img_convert/d12f9610d04226ad9323461419b33d84.png)
187.
![8a597c8391b757b190fc2ffc647315f3.png](https://img-blog.csdnimg.cn/img_convert/8a597c8391b757b190fc2ffc647315f3.png)
![8c2be49a800e7e24242db7716fe426a1.png](https://img-blog.csdnimg.cn/img_convert/8c2be49a800e7e24242db7716fe426a1.png)
Vector线程安全,ArrayList不安全
188.
![e6f8462fe0867cfd00836a10f1210ebb.png](https://img-blog.csdnimg.cn/img_convert/e6f8462fe0867cfd00836a10f1210ebb.png)
189.
![36c2560d15ace2379e5bb7a1758a9bd1.png](https://img-blog.csdnimg.cn/img_convert/36c2560d15ace2379e5bb7a1758a9bd1.png)
![5dd704f6a594d4c3c76af784581d4509.png](https://img-blog.csdnimg.cn/img_convert/5dd704f6a594d4c3c76af784581d4509.png)
190.
![800384f686f32d30f3596dd536400b3b.png](https://img-blog.csdnimg.cn/img_convert/800384f686f32d30f3596dd536400b3b.png)
![8f5acb01870431473917937a34fd5319.png](https://img-blog.csdnimg.cn/img_convert/8f5acb01870431473917937a34fd5319.png)
191.
![b1848c7fdbc1e928ad59446727bade84.png](https://img-blog.csdnimg.cn/img_convert/b1848c7fdbc1e928ad59446727bade84.png)
192.
![bee8f51e857189a1aef97183e72bd5ea.png](https://img-blog.csdnimg.cn/img_convert/bee8f51e857189a1aef97183e72bd5ea.png)
![dfbfb663ce344c92b9f219279a69f9b7.png](https://img-blog.csdnimg.cn/img_convert/dfbfb663ce344c92b9f219279a69f9b7.png)
193.
![85cf8bd91353064c7e200ee4dea48df9.png](https://img-blog.csdnimg.cn/img_convert/85cf8bd91353064c7e200ee4dea48df9.png)
194.
![ca76d1b861b5a91951b4a2827392c400.png](https://img-blog.csdnimg.cn/img_convert/ca76d1b861b5a91951b4a2827392c400.png)
195. java的hashMap和hashTable有什么区别?
![a24d41e0a3b386e2f526fe9bf37aac90.png](https://img-blog.csdnimg.cn/img_convert/a24d41e0a3b386e2f526fe9bf37aac90.png)
相同:实现原理相同,功能相同,底层都是哈希表结构,查询块,在很多情况下可以互用
![bc2b11f9e4365d02153d15452e1c8ee3.png](https://img-blog.csdnimg.cn/img_convert/bc2b11f9e4365d02153d15452e1c8ee3.png)
不同:hashtable是早期的JDK提供的接口,hashmap是新版jdk提供的接口
hashtable线程安全,hashmap线程不安全
hashtable继承了Dictionary类,hashmap继承了map接口
hashtable不允许null值,hashmap允许null值
196.HashSet和hashMap的区别?
![a650b2fc7194a7f8fd780a65bfd1943a.png](https://img-blog.csdnimg.cn/img_convert/a650b2fc7194a7f8fd780a65bfd1943a.png)
hashset底层是hashmap实现的,hashset的实现比较简单,hashset的大部分方法是调用hashmap方法实现的,,因此这两个集合本质上是相同的
区别:hashmap中的key就是放进hashset中的对象,value是Object类型的
当调用hashset的add方法时,实际上向hashmap中增加了一行key-value增加的对象,,该行的value就是一个Object类型的常量
197.列出java中集合类层次结构/
![af7d632a0ac5d6d911359921e12a3b10.png](https://img-blog.csdnimg.cn/img_convert/af7d632a0ac5d6d911359921e12a3b10.png)
java中集合主要分两种,Collection和map,Collection是List和set接口,的父接口,
ArrayList和linkedlist是list的实现类,hashset和treeset是set的实现类
LinkedHashset是hashset的子类
hashmap和treemap是map的实现类
LinkedHashMap是hashmap的子类
![033b4b3f3a0d05fbfa30c1f289b55c30.png](https://img-blog.csdnimg.cn/img_convert/033b4b3f3a0d05fbfa30c1f289b55c30.png)
![e1ccb6d5000fa22cff28b83bb60fa017.png](https://img-blog.csdnimg.cn/img_convert/e1ccb6d5000fa22cff28b83bb60fa017.png)
198List,set.map各有什么特点?
![ea609a44b5f37c3e87946472c3e6f11b.png](https://img-blog.csdnimg.cn/img_convert/ea609a44b5f37c3e87946472c3e6f11b.png)
199
![af5c2d1f4ca5bc16da6c39495a5038ba.png](https://img-blog.csdnimg.cn/img_convert/af5c2d1f4ca5bc16da6c39495a5038ba.png)
![d68b06125bb0cbcede2c0d22f3e14ce9.png](https://img-blog.csdnimg.cn/img_convert/d68b06125bb0cbcede2c0d22f3e14ce9.png)
200.
![8b2e6ac81c1e240e363808b04ab02ee1.png](https://img-blog.csdnimg.cn/img_convert/8b2e6ac81c1e240e363808b04ab02ee1.png)
![2c577d5e645b602258feb3eefc2c8454.png](https://img-blog.csdnimg.cn/img_convert/2c577d5e645b602258feb3eefc2c8454.png)
数组插入,删除效率差,Collection是集合的接口,不使某种数据结构
![26eed8b1aa33cd036277e97c67460d03.png](https://img-blog.csdnimg.cn/img_convert/26eed8b1aa33cd036277e97c67460d03.png)
stack是先进后出的栈,线性结构,,链表比较适合,,不适合散列表数据结构
201. Cookie和Session的区别?
1、存储位置不同
cookie的数据信息存放在客户端浏览器上。session的数据信息存放在服务器上。
2、存储容量不同
单个cookie保存的数据<=4KB,一个站点最多保存20个Cookie。
对于session来说并没有上限,但出于对服务器端的性能考虑,session内不要存放过多的东西,并且设置session删除机制。
3、存储方式不同
cookie中只能保管ASCII字符串,并需要通过编码方式存储为Unicode字符或者二进制数据。
session中能够存储任何类型的数据,包括且不限于string,integer,list,map等。
4、隐私策略不同
cookie对客户端是可见的,别有用心的人可以分析存放在本地的cookie并进行cookie欺骗,所以它是不安全的
session存储在服务器上,对客户端是透明对,不存在敏感信息泄漏的风险。
5、有效期上不同
开发可以通过设置cookie的属性,达到使cookie长期有效的效果。
session依赖于名为JSESSIONID的cookie,而cookie JSESSIONID的过期时间默认为-1,只需关闭窗口该session就会失效,因而session不能达到长期有效的效果。
6、服务器压力不同
cookie保管在客户端,不占用服务器资源。对于并发用户十分多的网站,cookie是很好的选择。
session是保管在服务器端的,每个用户都会产生一个session。假如并发访问的用户十分多,会产生十分多的session,耗费大量的内存。
跨域支持上不同
cookie支持跨域名访问。
session不支持跨域名访问。
202.请求转发和重定向的区别?
请求转发:request.getRequestDispatcher(URL地址).forward(request, response)
处理流程:
- 客户端发送请求,Servlet做出业务逻辑处理。
- Servlet调用forword()方法,服务器Servlet把目标资源返回给客户端浏览器。
请求转发
2)重定向:response.sendRedirect(URL地址)
转发中数据的存取可以用request作用域:request.setAttribute(),
request.getAttribute()
,重定向是取不到request中的数据的。只能用session。
![5f130151fc062b7a1501cd13185f641a.png](https://img-blog.csdnimg.cn/img_convert/5f130151fc062b7a1501cd13185f641a.png)
![6a3cfe303be73cafa1466160ca7fef34.png](https://img-blog.csdnimg.cn/img_convert/6a3cfe303be73cafa1466160ca7fef34.png)
203.SpringMVC拦截器机制,执行原理
MVC执行流程
![e052d428e3385f9329934c11879871cb.png](https://img-blog.csdnimg.cn/img_convert/e052d428e3385f9329934c11879871cb.png)
1、 用户发送请求,经过前端控制器Dispacherservlet(Controller的核心)将url交给处理器映射器HandlerMapping处理
2、 处理器映射器HandlerMapping处理url,返回HandlerExecutionChain(可能包含拦截器,一定包含自定义的Controller(handler))
3、 前端控制器将Controller交给处理器适配器HandlerAdapter处理,处理完成后,返回MV对象(ModelAndView)
4、 前端控制器将MV交给视图解析器处理ViewResolver,处理的过程:将MV拆分成Model和view两个对象,并且将model渲染到view视图上,并且将view返回给前端控制器。
5、 最后,前端控制器将视图响应给用户。
204.Cookie,Seesion,token的区别?
![66ed15ef8adc17d571a63fb4f26444d0.png](https://img-blog.csdnimg.cn/img_convert/66ed15ef8adc17d571a63fb4f26444d0.png)
![911cae947058bbfe7c134a35f969d9c9.png](https://img-blog.csdnimg.cn/img_convert/911cae947058bbfe7c134a35f969d9c9.png)
![36573367a78702eeab77add6c761b669.png](https://img-blog.csdnimg.cn/img_convert/36573367a78702eeab77add6c761b669.png)
205.
![8193d33f7c1e5608804c08ef0b96ffa7.png](https://img-blog.csdnimg.cn/img_convert/8193d33f7c1e5608804c08ef0b96ffa7.png)
206.
![963692255a58e201a1ad8e14a985c8a7.png](https://img-blog.csdnimg.cn/img_convert/963692255a58e201a1ad8e14a985c8a7.png)
207.
![69b2cc17d59b67ddda96b49c5ade602e.png](https://img-blog.csdnimg.cn/img_convert/69b2cc17d59b67ddda96b49c5ade602e.png)
![6c42d972c366871266605fa22bd787af.png](https://img-blog.csdnimg.cn/img_convert/6c42d972c366871266605fa22bd787af.png)
Treeset要求存放的对象所属的类必须实现Comparable接口,,该接口提供了比较元素的compareTo方法,当插入元素时,回调比较元素的大小;
TreeMap要求存放的键值对映射的K实现Comparable接口,从而根据键对元素进行排序;
208.
![8dedc1fad8d097de66580c3c5cad7c3e.png](https://img-blog.csdnimg.cn/img_convert/8dedc1fad8d097de66580c3c5cad7c3e.png)
![c87e363e1a8d55c8874afb84a7421c4c.png](https://img-blog.csdnimg.cn/img_convert/c87e363e1a8d55c8874afb84a7421c4c.png)
209.循环队列中元素的个数由队头和队尾指针共同决定,,元素的动态变化也是通过队首指针和队尾指针;来反应的,当队首等于队尾时,队列为空,是线性结构,,
![e58bfbad68606efc1ea3f634f670f6d2.png](https://img-blog.csdnimg.cn/img_convert/e58bfbad68606efc1ea3f634f670f6d2.png)
210.List,set,map是否继承Collection接口?
![9fa40d3ac37cc1aa54942e260bf3431e.png](https://img-blog.csdnimg.cn/img_convert/9fa40d3ac37cc1aa54942e260bf3431e.png)
211.Arraylisy和vector使用数组方式存储,数组元素大于实际存储的数据,以便插入和增加元素,都允许按照序号索引元素,,插入索引设计到数组移动,,所以索引数据更块
Vector使用synchronzied方法,线程安全,,,性能较ArrayList差,,
ArrayList双向链表,,按照索引数据向前向后遍历,,,,插入只需要记录前后项即可,,,插入块
![66f206e34b1894f0e51b1f2b7af87d45.png](https://img-blog.csdnimg.cn/img_convert/66f206e34b1894f0e51b1f2b7af87d45.png)
212.
![df21dbafe7673140a8830d1037aea21b.png](https://img-blog.csdnimg.cn/img_convert/df21dbafe7673140a8830d1037aea21b.png)
213.
![8d0b3ce24ecd6fc530693637b20dfde4.png](https://img-blog.csdnimg.cn/img_convert/8d0b3ce24ecd6fc530693637b20dfde4.png)
214.
![8cdf57ff0768e09630f673a5143e9a1f.png](https://img-blog.csdnimg.cn/img_convert/8cdf57ff0768e09630f673a5143e9a1f.png)
![f69765c43e5ff7e67e757db02b86f43a.png](https://img-blog.csdnimg.cn/img_convert/f69765c43e5ff7e67e757db02b86f43a.png)
![71645bf311e228b9ffc0010c973a29f4.png](https://img-blog.csdnimg.cn/img_convert/71645bf311e228b9ffc0010c973a29f4.png)
.悲观锁是当线程拿到资源时,就对资源上锁,并在提交后,才释放锁资源,其他线程才能使用资源。
乐观锁是当线程拿到资源时,上乐观锁,在提交之前,其他的锁也可以操作这个资源,当有冲突的时候,并发机制会保留前一个提交,打回后一个提交,让后一个线程重新获取资源后,再操作,然后提交。和git上传代码一样,两个线程都不是直接获取资源本身,而是先获取资源的两个copy版本,然后在这两个copy版本上修改。
.悲观锁和乐观锁在并发量低的时候,性能差不多,但是在并发量高的时候, 乐观锁的性能远远优于悲观锁。.我们常用的synchronized是悲观锁,lock是乐观锁 。
215.多个线程同时访问同一资源时,容易出现线程安全,需要以某种方式保证某一时刻只被一个线程使用,让线程同步,,保证数据安全线程同步的实现
![2f6623ed2499545edc55387774336a4f.png](https://img-blog.csdnimg.cn/img_convert/2f6623ed2499545edc55387774336a4f.png)
![ca3744acc04c0817da819bfeae651b4d.png](https://img-blog.csdnimg.cn/img_convert/ca3744acc04c0817da819bfeae651b4d.png)
![257c6d4b4441eeef8117359840860d2b.png](https://img-blog.csdnimg.cn/img_convert/257c6d4b4441eeef8117359840860d2b.png)
![9172606d3c1aabde811ebdb5b3d749bc.png](https://img-blog.csdnimg.cn/img_convert/9172606d3c1aabde811ebdb5b3d749bc.png)
![3314d90f2a4c8633ac4cb6cee1f5cb15.png](https://img-blog.csdnimg.cn/img_convert/3314d90f2a4c8633ac4cb6cee1f5cb15.png)
![154cd607847962372c78d877a57bae8a.png](https://img-blog.csdnimg.cn/img_convert/154cd607847962372c78d877a57bae8a.png)
继承thread,编写简单,无法继承其他父类,,,
实现Runnable接口,,可以继承其他类,多个线程共享同一个thread对象,,
编程复杂,,访问当前线程,,需要调用Thread.currentThread方法
216.wait方法是线程通信的方法之一,用在synchronized方法或者synchronized代码块,否则抛出异常,用在锁的对象上来调用,,使该对象的锁进入线程等待状态,,直到对象调用notify方法唤醒之前进入等待状态,释放持有的锁
![b34b003c7986ea26faa6cc6fe92e6d0a.png](https://img-blog.csdnimg.cn/img_convert/b34b003c7986ea26faa6cc6fe92e6d0a.png)
217
![c3342ed226bf51772b56cfeade7bdee6.png](https://img-blog.csdnimg.cn/img_convert/c3342ed226bf51772b56cfeade7bdee6.png)
![0dc6047e5b88cfd4aa4aa719cb0bfdac.png](https://img-blog.csdnimg.cn/img_convert/0dc6047e5b88cfd4aa4aa719cb0bfdac.png)
.
![60d855bf71e0870b64a9cdf5745285f1.png](https://img-blog.csdnimg.cn/img_convert/60d855bf71e0870b64a9cdf5745285f1.png)
218.
![76d48a1d23f4f77370b4ef58bdfd4078.png](https://img-blog.csdnimg.cn/img_convert/76d48a1d23f4f77370b4ef58bdfd4078.png)
![3f273a6ff6991e3d8b2478e646e00c59.png](https://img-blog.csdnimg.cn/img_convert/3f273a6ff6991e3d8b2478e646e00c59.png)
![d753dfe25ebea4ce00a4fdb544ceaf18.png](https://img-blog.csdnimg.cn/img_convert/d753dfe25ebea4ce00a4fdb544ceaf18.png)
219.
![603de974c928be23935bd7705bff819b.png](https://img-blog.csdnimg.cn/img_convert/603de974c928be23935bd7705bff819b.png)
220.进程和线程的区别?
![e3ac89105f95a7949f77f4734cbfd5f0.png](https://img-blog.csdnimg.cn/img_convert/e3ac89105f95a7949f77f4734cbfd5f0.png)
![c4fe74cb82221f4178e92f5868ef914b.png](https://img-blog.csdnimg.cn/img_convert/c4fe74cb82221f4178e92f5868ef914b.png)
![a7bda03be1c9577a606f04256b8357c1.png](https://img-blog.csdnimg.cn/img_convert/a7bda03be1c9577a606f04256b8357c1.png)
for循环,,wait方法,让所有线程处于就绪状态,调用notify(,同时,,启动所有线程)
![e085a9c8e2595b74166244aa65dbcb09.png](https://img-blog.csdnimg.cn/img_convert/e085a9c8e2595b74166244aa65dbcb09.png)
221.sleep是线程类thread的方法,,,导致此线程暂停执行等待时间,,执行给其他线程,但是监控状态依然存在,,不会释放对象锁
wait是Object方法,放弃对象锁,,进入等待此对象的等待池,,针对发出notify方法本线程进入对象池,准备获得对象锁进行运行状态
![1642e1f68d071870d09780ad42e124cf.png](https://img-blog.csdnimg.cn/img_convert/1642e1f68d071870d09780ad42e124cf.png)
222.
![eb1a54adfa32030395a6fe304ba626f3.png](https://img-blog.csdnimg.cn/img_convert/eb1a54adfa32030395a6fe304ba626f3.png)
![c2b1a2f3cb062cbe6b1d98e2a97ef589.png](https://img-blog.csdnimg.cn/img_convert/c2b1a2f3cb062cbe6b1d98e2a97ef589.png)
223.
![edf2defca0d6de825a2ab0fe23de5ff0.png](https://img-blog.csdnimg.cn/img_convert/edf2defca0d6de825a2ab0fe23de5ff0.png)
![0f3be2813d2f1dbdf128f0a99d96da48.png](https://img-blog.csdnimg.cn/img_convert/0f3be2813d2f1dbdf128f0a99d96da48.png)
![8b456f161c524fdf5fd00057373701c5.png](https://img-blog.csdnimg.cn/img_convert/8b456f161c524fdf5fd00057373701c5.png)
![110696197c7b1da3c35a150ebc3a7f96.png](https://img-blog.csdnimg.cn/img_convert/110696197c7b1da3c35a150ebc3a7f96.png)
224.
![83682eab5a7be2fa70ba57dff7038176.png](https://img-blog.csdnimg.cn/img_convert/83682eab5a7be2fa70ba57dff7038176.png)
![a55149ef5e5deb435e9e9ed51d67fbf0.png](https://img-blog.csdnimg.cn/img_convert/a55149ef5e5deb435e9e9ed51d67fbf0.png)
225.线程的基本状态和状态之间的关系?
![197ea7fddd927058a6465f67c513166f.png](https://img-blog.csdnimg.cn/img_convert/197ea7fddd927058a6465f67c513166f.png)
![0ba6a3f1b4ba8362a768bb1cacb13cc7.png](https://img-blog.csdnimg.cn/img_convert/0ba6a3f1b4ba8362a768bb1cacb13cc7.png)
![b8ebd56d0a83b67519f3ef335b7fb072.png](https://img-blog.csdnimg.cn/img_convert/b8ebd56d0a83b67519f3ef335b7fb072.png)
![1c4efc2f77fca66c28302d01070f14c7.png](https://img-blog.csdnimg.cn/img_convert/1c4efc2f77fca66c28302d01070f14c7.png)
![dfe42dbb1cac03b7d3e06d7138f28478.png](https://img-blog.csdnimg.cn/img_convert/dfe42dbb1cac03b7d3e06d7138f28478.png)
![61e1c461d808614a4167d40b33b2c97e.png](https://img-blog.csdnimg.cn/img_convert/61e1c461d808614a4167d40b33b2c97e.png)
226.
![3f5800a228c382107aab2c89b95f29fa.png](https://img-blog.csdnimg.cn/img_convert/3f5800a228c382107aab2c89b95f29fa.png)
![12d8fec5c8e692a675e9c4409d4439ce.png](https://img-blog.csdnimg.cn/img_convert/12d8fec5c8e692a675e9c4409d4439ce.png)
![78a9d1d233af85394408de40beb23008.png](https://img-blog.csdnimg.cn/img_convert/78a9d1d233af85394408de40beb23008.png)
![ca6496df6060e9f29778166ef1b99b86.png](https://img-blog.csdnimg.cn/img_convert/ca6496df6060e9f29778166ef1b99b86.png)
![16304164b0d7519fb0caf360d40b4384.png](https://img-blog.csdnimg.cn/img_convert/16304164b0d7519fb0caf360d40b4384.png)
227.如何实现序列化?
![42bac026aaf5a2d72979dd8bb2f8d8a7.png](https://img-blog.csdnimg.cn/img_convert/42bac026aaf5a2d72979dd8bb2f8d8a7.png)
![e0d743eb48b607cc15f226988d01b51f.png](https://img-blog.csdnimg.cn/img_convert/e0d743eb48b607cc15f226988d01b51f.png)
228.
![95351d372438493b0e85e6dac6c95f40.png](https://img-blog.csdnimg.cn/img_convert/95351d372438493b0e85e6dac6c95f40.png)
229.
![fc6b6407cc557d9ac3dd4ebedbd1c800.png](https://img-blog.csdnimg.cn/img_convert/fc6b6407cc557d9ac3dd4ebedbd1c800.png)
![ff0d1bf9c13a122372219a1fa975ce0b.png](https://img-blog.csdnimg.cn/img_convert/ff0d1bf9c13a122372219a1fa975ce0b.png)
![186d1afc48bee67acb094f54e8a56522.png](https://img-blog.csdnimg.cn/img_convert/186d1afc48bee67acb094f54e8a56522.png)
230.
![3645731c1c586d73aa51ec0a3fea1f76.png](https://img-blog.csdnimg.cn/img_convert/3645731c1c586d73aa51ec0a3fea1f76.png)
![1ce97f81d4899304e5da5fb4646329c5.png](https://img-blog.csdnimg.cn/img_convert/1ce97f81d4899304e5da5fb4646329c5.png)
![9096694915b8ff125f50c21e50fe201f.png](https://img-blog.csdnimg.cn/img_convert/9096694915b8ff125f50c21e50fe201f.png)
![c7dc702445d6d0a329cdd01c7da77f24.png](https://img-blog.csdnimg.cn/img_convert/c7dc702445d6d0a329cdd01c7da77f24.png)
231.
![7a064217b00f6be5ec0f23dc8228a34b.png](https://img-blog.csdnimg.cn/img_convert/7a064217b00f6be5ec0f23dc8228a34b.png)
232.
![31fdd6dfa8435705bc6116a1936fc762.png](https://img-blog.csdnimg.cn/img_convert/31fdd6dfa8435705bc6116a1936fc762.png)
![2a0aa152fd261cfe5c7c8a77295a028c.png](https://img-blog.csdnimg.cn/img_convert/2a0aa152fd261cfe5c7c8a77295a028c.png)
web方面
233.web应用中.class文件存放在web/Inf/classes文件下,,.jar文件放在web/inf/lib中
![68c97f626d4df7eb4a246e7fcf357b6a.png](https://img-blog.csdnimg.cn/img_convert/68c97f626d4df7eb4a246e7fcf357b6a.png)
![d13d40b85a37cea47a509cf74110dcc4.png](https://img-blog.csdnimg.cn/img_convert/d13d40b85a37cea47a509cf74110dcc4.png)
![7524a5ed93792a9d51366abc96f0cf06.png](https://img-blog.csdnimg.cn/img_convert/7524a5ed93792a9d51366abc96f0cf06.png)
![2ba8aa3bb11bb1620559f60df7835ffa.png](https://img-blog.csdnimg.cn/img_convert/2ba8aa3bb11bb1620559f60df7835ffa.png)
234.
![b46c0c9cea1b7d5311fada1d440f5d5b.png](https://img-blog.csdnimg.cn/img_convert/b46c0c9cea1b7d5311fada1d440f5d5b.png)
![a6ba98c7bffba7fcc3dbe52eb41be8f0.png](https://img-blog.csdnimg.cn/img_convert/a6ba98c7bffba7fcc3dbe52eb41be8f0.png)
![4e0e0dd9e39fe3a77f93a56c017fb4fc.png](https://img-blog.csdnimg.cn/img_convert/4e0e0dd9e39fe3a77f93a56c017fb4fc.png)
235.
![6d5c5f5675b27627672ee477a041609e.png](https://img-blog.csdnimg.cn/img_convert/6d5c5f5675b27627672ee477a041609e.png)
![cb559d613524a69a1a2b1aa642dbb826.png](https://img-blog.csdnimg.cn/img_convert/cb559d613524a69a1a2b1aa642dbb826.png)
236.
![a98cc38160ec14534951e48857c3930c.png](https://img-blog.csdnimg.cn/img_convert/a98cc38160ec14534951e48857c3930c.png)
237
![a93473a858e8b4540e88fc38c7438318.png](https://img-blog.csdnimg.cn/img_convert/a93473a858e8b4540e88fc38c7438318.png)
![c42391c16b39efde6a85ed31a90648dd.png](https://img-blog.csdnimg.cn/img_convert/c42391c16b39efde6a85ed31a90648dd.png)
![fc8b62afc3077d590294f0cc6cfe0e09.png](https://img-blog.csdnimg.cn/img_convert/fc8b62afc3077d590294f0cc6cfe0e09.png)
![d6570ad82065888389e986cea50643ce.png](https://img-blog.csdnimg.cn/img_convert/d6570ad82065888389e986cea50643ce.png)
311
![9bc559273f76bf7645ffb1bfd3e89985.png](https://img-blog.csdnimg.cn/img_convert/9bc559273f76bf7645ffb1bfd3e89985.png)
![3997b56deff33e2afa71ddae9b48a284.png](https://img-blog.csdnimg.cn/img_convert/3997b56deff33e2afa71ddae9b48a284.png)
![3242e245a8bae7a331337e6a53aefd6c.png](https://img-blog.csdnimg.cn/img_convert/3242e245a8bae7a331337e6a53aefd6c.png)
![0ca755e44393ebad3ef37dc4e2d379d0.png](https://img-blog.csdnimg.cn/img_convert/0ca755e44393ebad3ef37dc4e2d379d0.png)
312.
![ca0f5c9682184b8ed594d6ff89e4f060.png](https://img-blog.csdnimg.cn/img_convert/ca0f5c9682184b8ed594d6ff89e4f060.png)
313.
![2890b7fa7e9c6c3aed2f628ad420bd7b.png](https://img-blog.csdnimg.cn/img_convert/2890b7fa7e9c6c3aed2f628ad420bd7b.png)
![f4d5b5e479b2e48f3f5ee4289a79c204.png](https://img-blog.csdnimg.cn/img_convert/f4d5b5e479b2e48f3f5ee4289a79c204.png)
314.
![08db231035dabd008835da1b576d4666.png](https://img-blog.csdnimg.cn/img_convert/08db231035dabd008835da1b576d4666.png)
有问题,,结果,,
![3218f0d0d5e8934324c8c2ca88e60947.png](https://img-blog.csdnimg.cn/img_convert/3218f0d0d5e8934324c8c2ca88e60947.png)
![64d62cb5574a0a57d130dd07c09d3188.png](https://img-blog.csdnimg.cn/img_convert/64d62cb5574a0a57d130dd07c09d3188.png)
![bcb3515b6640a1397d2b48a70b8e4143.png](https://img-blog.csdnimg.cn/img_convert/bcb3515b6640a1397d2b48a70b8e4143.png)
315.
![9193ffe3e3441be1b06ed98d845ee169.png](https://img-blog.csdnimg.cn/img_convert/9193ffe3e3441be1b06ed98d845ee169.png)
![d5a8c6da0067c42393fe4f7aaafa0895.png](https://img-blog.csdnimg.cn/img_convert/d5a8c6da0067c42393fe4f7aaafa0895.png)
![681a9fbf27a698bf14209480815bf3ed.png](https://img-blog.csdnimg.cn/img_convert/681a9fbf27a698bf14209480815bf3ed.png)
![0788a64ca14823cd0908ecbfb147bed8.png](https://img-blog.csdnimg.cn/img_convert/0788a64ca14823cd0908ecbfb147bed8.png)
![d594a829227a8c35e3c8948f6b9e944e.png](https://img-blog.csdnimg.cn/img_convert/d594a829227a8c35e3c8948f6b9e944e.png)
![8401008cc8d82cb1320f6dcc5ee87e93.png](https://img-blog.csdnimg.cn/img_convert/8401008cc8d82cb1320f6dcc5ee87e93.png)
![700c7ba878b11039d86142686a3db90d.png](https://img-blog.csdnimg.cn/img_convert/700c7ba878b11039d86142686a3db90d.png)
![6098bb9b7f6c5c9eab1029a2bf46976c.png](https://img-blog.csdnimg.cn/img_convert/6098bb9b7f6c5c9eab1029a2bf46976c.png)
![e4feae110be48fc9e49cec7865f24a1d.png](https://img-blog.csdnimg.cn/img_convert/e4feae110be48fc9e49cec7865f24a1d.png)
344.
![035dc29f22b918599be2548cd2e8aa2b.png](https://img-blog.csdnimg.cn/img_convert/035dc29f22b918599be2548cd2e8aa2b.png)
350.
![5bb7e4e1b5ea252e179d0b7a48cde4bb.png](https://img-blog.csdnimg.cn/img_convert/5bb7e4e1b5ea252e179d0b7a48cde4bb.png)
352
![b4ee65a03dbe567a77c0968455b14295.png](https://img-blog.csdnimg.cn/img_convert/b4ee65a03dbe567a77c0968455b14295.png)
![1cf5246bd2960595e724b30ae0ba3350.png](https://img-blog.csdnimg.cn/img_convert/1cf5246bd2960595e724b30ae0ba3350.png)
![61fe717b8f07a7e84cdc44c39f8d21a6.png](https://img-blog.csdnimg.cn/img_convert/61fe717b8f07a7e84cdc44c39f8d21a6.png)
![0aa4ca43d8b4aac0424f2a8a75a03e08.png](https://img-blog.csdnimg.cn/img_convert/0aa4ca43d8b4aac0424f2a8a75a03e08.png)
359.
![d1357b4d2ba880ea38f7ffab478c28e3.png](https://img-blog.csdnimg.cn/img_convert/d1357b4d2ba880ea38f7ffab478c28e3.png)
![dbf58bc97fd0049e37df97b12516e4df.png](https://img-blog.csdnimg.cn/img_convert/dbf58bc97fd0049e37df97b12516e4df.png)
360.全选checkbox对象///checked=true
![63cda1ff3d86a0181e4675ff972dcc77.png](https://img-blog.csdnimg.cn/img_convert/63cda1ff3d86a0181e4675ff972dcc77.png)
![a0bb066e7caa4ff1c58c0a59f6b9b878.png](https://img-blog.csdnimg.cn/img_convert/a0bb066e7caa4ff1c58c0a59f6b9b878.png)
370.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>测试Ajax</title>
</head>
<body>
<script type="text/javascript">
function testAjax(){
$.ajax(){
url:"testAjax",//请求地址
type:"get",//请求的方式
data:{uname:"zhangsan",realname:"lisi"},//请求参数JAON或者是string
//data:"uname=zhangsan&realname=lisi",
cache:false,//true为走缓存,false为不走缓存
asyn:false,//true为异步,false为同步
success:function(result){
alert(result);
/**
* 当Ajax发送成功后,会调用函数
* result为形参,返回的数据
*/
}
}
}
/**
* ajax的get提交
* 当Ajax调用成功后,会调用callback函数
*/
function getAjax(){
$.get("testAjax",{name:"zhangsan",realname:"lisi",function(result){
alert(result);
}};
}
/**
* ajax的post提交
* 当Ajax调用成功后,会调用callback函数
*/
function PostAjax(){
$.post("testAjax",{name:"zhangsan",realname:"lisi"},function(result){
alert(result);
});
}
</script>
</body>
</html>
![02879992c150bb9c873bf3b452a0121d.png](https://img-blog.csdnimg.cn/img_convert/02879992c150bb9c873bf3b452a0121d.png)
![218cb77e94fd64695a823b7e0898cccd.png](https://img-blog.csdnimg.cn/img_convert/218cb77e94fd64695a823b7e0898cccd.png)
382.
![5479cb9bcb614e8fcff4a94b1ede7132.png](https://img-blog.csdnimg.cn/img_convert/5479cb9bcb614e8fcff4a94b1ede7132.png)
383.
![3c544c0c05609b561a570796c427df8d.png](https://img-blog.csdnimg.cn/img_convert/3c544c0c05609b561a570796c427df8d.png)
![1b3999e3cfe86fa873d3848c2f1253e3.png](https://img-blog.csdnimg.cn/img_convert/1b3999e3cfe86fa873d3848c2f1253e3.png)
![683aff7809cb145a75bb4ae9510c6dc9.png](https://img-blog.csdnimg.cn/img_convert/683aff7809cb145a75bb4ae9510c6dc9.png)
393.
![248339e52d16edce59234c51adcc6382.png](https://img-blog.csdnimg.cn/img_convert/248339e52d16edce59234c51adcc6382.png)