GithubHelp home page GithubHelp logo

mytomcat's Introduction

实现简单的Tomcat

  1. 自定义servlet接口,设计server()方法以及init()和destroy()方法
  2. 自定义HttpServlet抽象类,继承servlet接口实现server()等方法,定义抽象方法doGet()和doPost()方法用于处理请求
  3. 定义Servlet,继承HttpServlet实现doGet和doPost方法
  4. 自定义HttpRequest 和 HttpResponse 根据socket中的 InputStream 和 OutputStream 后去请求信息以及返回数据
  5. 使用dom4j实现init()方法读取web.xml内容初始化 uri-servletName关联map 和 servletName-servlet实例关联map
  6. main方法新建一个ServiceSocket监听本地端口,遇到请求链接则启动新的线程进入HttpRequestHandler
  7. 在HttpRequestHandler中根据InputStream和OutputStream完成HttpRequest 和 HttpResponse的初始化
  8. 根据HttpRequest中的uri获取到相应的servlet实例,调用servlet实例server()方法完成对请求的处理

mytomcat's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.