摘要:今天根据我到网上查找资料,学习servlet加载。参考来自http://www.bitscn.com/pdb/java/200807/145683.htmlservlet 加载:容器的Context对象对请求路径(URL)作出处理,去掉请求URL的上下文路径后,按路径映射规则(web.xml文件)和Servlet映射路径(<url-pattern>)做匹配,如果匹配成功,则调用这个Servlet处理请求。匹配规则:请求URL精确匹配,如果成功则调用该Servlet。 匹配最长的路径前缀,以/为路径分隔符,按路径树逐级匹配,选择最长匹配的Servlet来处理。 如果前面都没有匹配成功
阅读全文
摘要:HTTP(HyperText Transfer Protocol)是一套计算机通过网络进行通信的规则。计算机专家设计出HTTP,使HTTP客户(如Web浏览器)能够从HTTP服务器(Web服务器)请求信息和服务,HTTP目前协议的版本是1.1.HTTP是一种无状态的协议,无状态是指Web浏览器和Web服务器之间不需要建立持久的连接,这意味着当一个客户端向服务器端发出请求,然后Web服务器返回响应(response),连接就被关闭了,在服务器端不保留连接的有关信息.HTTP遵循请求(Request)/应答(Response)模型。Web浏览器向Web服务器发送请求,Web服务器处理请求并返回适当
阅读全文
摘要:A: User clicks a link that has a URL to a servlet.B: The Container "sees" that the request is for a servlet, so the container creates two objects: 1) HttpServletsResponse 2) HttpServletRequestC: The Container finds the correct servlet based on the URL in the request, creates or allocates a
阅读全文
摘要:We know it is the Container that manages and runs the servlet,but why? Is it worth the extra overhead?Communications support: The container provides an easy way for your servlets to talk to your web server. You do not have to build a ServerSocket,listen on a port, create streams,etc. The Container k
阅读全文
摘要:What happens after we type "www.baidu.com"?First the browser creates a HTTP GET request like this:GET/index.html HTTP/1.1Host:www.baidu.comUser-Agent: GoogleChrome/.............Then the HTTP GET is sent to the server,and the server finds the page index.html of baidu. Then the sever generat
阅读全文
摘要:The total amount of characters in a GET is really limited (depending on the server).If the user types ,say. along passage into a "search" into a box,the Get might not work.The data you send with the GET is appended to the URL up in the browser bar,so whatever you send is exposed.Better not
阅读全文
摘要:What`s the content of web?The web consists of gazillions of clients(using browsers like Mozilla or IE ) and servers (using web server apps like Apache) connected through wires and wireless networks.What does your web server do ?A web server takes a client request and gives something back to the clie
阅读全文
摘要:The first thing you read this book is to prepare you brain to study.The first work you need to learn this book is to install and config Tomcat.Before I have done a few projects use MyEclipse or Eclipse, In these IDE, I never think how tomcat to start by only click an button.Now without the IDE ,befo
阅读全文