Code Monkey home page Code Monkey logo

myserver's Introduction

框架介绍

server包

  1. WebDom4j.java: 用于解析web.xml文档
  2. Entity.java: 存放servlet-name和servlet-class的映射实体信息
  3. Mapping.java: 存放servlet-name和url-pattern的映射实体信息
  4. ServletContent.java: 将存放Entity和Mapping的容器, 存放成Map容器
  5. WebApp.java: 存放一个ServletContent对象, 使用WebDom4j对象解析web.xml文档, 并初始化ServeltContent对象
  6. Request.java: 访问请求对象, 当客户端连接的时候, 会新建一个Request对象
  7. Response.java: 服务器响应对象, 用于服务器向客户端传递信息
  8. Dispatcher.java: 多线程类, 每有一个客户端连接, 则会新建立一个Dispatcher对象, 实现并发访问
  9. Server.java: 服务器主类, 使用WebApp实现给我一个url, 返回一个Servlet对象, 对Servlet对象进行操作

servlet包

  1. Servlet.java: 所有Servlet的抽象父类, 里边有两个抽象方法doPost和doGet, 分别对应get访问方式和post访问方式, service方法调用doGet方法
  2. LoginServlet.java: 登录的Servlet类, 继承自Servlet类

util包

此包为工具包

  1. CloseUtil.java: 内部只有一个方法, close方法, 参数是一个不固定的Closeable类型, 将接收到的参数关闭

WEB_INFO包

  1. web.xml: 里边包含了访问页面的配置信息

使用的jar包

  • DOM4j1.6.1.jar: 解析xml文档使用dom4j方式

运行项目

运行pers.jssd.server.Server.java文件即可启动服务器, 可使用index.html文件测试

myserver's People

Contributors

jssda avatar

Stargazers

TaiDongX avatar

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.