![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
shangjun2018
这个作者很懒,什么都没留下…
展开
-
httpclient基本用法
maven基础依赖 org.apache.httpcomponents httpclient x.x.x HttpClient 的基本用法 // 初始化httpclient CloseableHttpClient httpclient = HttpClients.createDefault(); // 简单生成get请求 HttpGet httpget = new HttpGet(“http://localhost/”); // 存放返回内容的类 CloseableHttpResponse..原创 2020-09-08 08:53:33 · 274 阅读 · 1 评论 -
常用http 状态code
```java HttpStatus = { //Informational 1xx 信息 '100' : 'Continue', //继续 '101' : 'Switching Protocols', //交换协议 //Successful 2xx 成功 '200' : 'OK', //OK '201' : 'Created', //创建 '202' : 'Accepted.原创 2020-09-02 16:47:46 · 129 阅读 · 0 评论 -
spring经典三层与洋葱结构(未完成)
Controller -> Biz -> Mapper接口 -> xml文件映射->数据库 数据库->vo实体类-> Biz-> Controller 在开发的接口中,controller层接收传递进来的参数,传递给biz类(service层),经过mapper接口进入xml文件进行对数据库的查询。 之后将返回的列值对应至entity实体类中(此处返回的列名字需要和实体类的属性保持一致),经过servier层实现类,将类属性传递给controller进而返回前端。原创 2020-09-02 16:20:57 · 267 阅读 · 1 评论 -
pom文件中parent标签的应用
场景假设: A, B, C三个项目均依赖 common.jar ; A, B 依赖 SpringMVC.jar。 当 common.jar 包和 SpringMVC.jar 进行了更新,则三个项目的pom包均需要对其进行更新。 引入新的设计。 新设定一个项目 parent, 其内部没有代码, 只有pom文件。 pom: xxxCompany common.jar 1.0.1 <denpendencyManagement> <groupId> xxxCom..原创 2020-09-01 21:02:00 · 2441 阅读 · 0 评论 -
Java接口的实际使用&为什么java要用接口
接口写法说明: 注: 本文本主要用来说明,接口在工程中的应用。 模拟的场景: 角色:三辆车,一个加油站, 一个司机。 动作:加油。 先写一个接口: // 油接口 public interface Oil { void setOilNum(int Num); boolean useOil(); int queryOilNum(); } 四个实体类(三辆车继承接口油,人是普通的类): //mustang package understandinginterface.car; imp原创 2020-08-06 20:50:28 · 265 阅读 · 1 评论