熟悉javaEE主流框架Springboot,SpringCloud,Mybatis,了解Servlet,JDBC

什么是Tomcat

阿帕奇提供的小型服务器软件,支持servet和jsp规范
lib包:存放jar包
WabApp:发布项目的目录
work:jsp编译生成。class的目录
LOgs:存放日志文件

HTTP协议

请求行,请求头和请求体
请求行:
        请求方法  请求URL   HTTP版本
请求头:
        Host:
        User-Agent:
        Accept:
        Accept-Language
        Accept-Encoding:
        Referer:
        onnection:
        Cookie:
请求体:
        get没有请求体,即跟在URL后面,post有请求体,不展示在地址栏里

响应行,响应头和响应体
 1 响应行:
 2         HTTP协议  状态码
 3 响应头:
 4         Accept-Ranges: bytes
 5         Cache-Control: max-age=0
 6         Connection: keep-alive
 7         Content-Length: 114
 8         Content-Type: text/html
 9         Date: Sun, 01 Sep 2019 14:09:54 GMT
10         Etag: "5d2c473c-72"
11         Expires: Sun, 01 Sep 2019 14:09:54 GMT
12         Last-Modified: Mon, 15 Jul 2019 09:28:28 GMT
13         Server: nginx
14 请求体:
15         图片,文本,html ......          200 正常  302 重定向  404 路径找不到  500 内部错误

对Servlet的了解

servlet指server+applet 服务端程序
用来处理客户端的请求并对请求做出响应

使用servlet需要导入Tomcat中的servlet.jar和api.jar

获得参数:String unsername = request.getParameter("username");
在内存中是单例的
生命周期:
创建:第一次被访问时,调用init()方法
工作:调用doGET和doPOST方法
销毁:调用Destory方法

JDBC

c3p0-config.xml

public class ConSql {
    public void test1() throws SQLException {
        QueryRunner queryRunner = new QueryRunner(new ComboPooledDataSource());
        String sql = "insert into student values(?,?,?)";
        Object[] obj = {14,"df",32};
        queryRunner.update(sql,obj);
    }
}

<dependency>
            <groupId>com.mchangegroupId>
            <artifactId>c3p0artifactId>
            <version>0.9.5.2version>
        dependency>
        <dependency>
            <groupId>mysqlgroupId>
            <artifactId>mysql-connector-javaartifactId>
            <version>5.1.6version>
        dependency>
        <dependency>
            <groupId>commons-dbutilsgroupId>
            <artifactId>commons-dbutilsartifactId>
            <version>1.6version>
        dependency>

Original: https://www.cnblogs.com/cheng9999/p/11963889.html
Author: cheng_blog
Title: 熟悉javaEE主流框架Springboot,SpringCloud,Mybatis,了解Servlet,JDBC

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/711017/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球