1 / 32

第一讲 J2EE 基础

第一讲 J2EE 基础. 博和利初级培训 — 开发技能. 技术路线与开源产品. 技术路线 J2EE Development without EJB 开源产品 Tomcat, JBoss, MySQL, Struts, Spring, Hibernate, Acegi, ValueList, JXL, Pentaho, JasperReport, iReport, JFreeChart, JBPM ……. 企业级应用架构. Acegi. Struts. JSP/JSTL/Taglib. PDF/Excel. FreeMarker/ Velocity.

Download Presentation

第一讲 J2EE 基础

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 第一讲 J2EE基础 博和利初级培训—开发技能

  2. 技术路线与开源产品 技术路线 J2EE Development without EJB 开源产品 Tomcat, JBoss, MySQL, Struts, Spring, Hibernate, Acegi, ValueList, JXL, Pentaho, JasperReport, iReport, JFreeChart, JBPM ……

  3. 企业级应用架构 Acegi Struts JSP/JSTL/Taglib PDF/Excel FreeMarker/ Velocity Spring Hibernate JDBC Tomcat / JBoss JVM Max OS X Unix Windows Linux SQL Server MySQL Oracle

  4. Struts + Spring + Hibernate UI Layer Business Layer Persistence Layer Spring Hibernate Struts - MVC DAO Classes Service Locator DataSource, Connection Pool Transactions Struts Action, ActionForm, JSP, struts-config.xml, etc Hibernate Session Management Query Language Support and other Hibernate services Business Service Classes Domain Model Business Objects

  5. Http协议的简单介绍 • HTTP,Hyper Text Transfer Protocol超文本 传输协议 • 浏览器将客户端请求(Request)形成符合HTTP协议的流传递给服务器。 • 服务器根据客户浏览器的请求进行处理,将结果形 成符合HTTP协议的流,返回给客户端,形成响应(Response) • 请求-响应形成了HTTP协议的基本通信方式 • 这些形成的流通常是文本流

  6. 一个典型的<form> • <form method="post" name="loginForm" action=“/login“> • 用户名: • <input name="username"><br> • 密&nbsp;&nbsp;码: • <input name="password" type="password"> • <br> • <input type="submit" value="提交"> • </form>

  7. 浏览器与服务器交互 Response Request

  8. 一个典型的Http请求 POST http://download.microtool.de/login HTTP/1.1 Host: download.microtool.de Accept:*/* Pragma: no-cache Cache-Control: no-cache Referer: http://download.microtool.de/ User-Agent:Mozilla/4.04[en](Win95;I;Nav) Username=yuannan&password=111111

  9. HTTP请求剖析 POST http://download.microtool.de/login HTTP/1.1 通过POST方法获得指定URL下的文件。 除了POST方法以外,还有GET,DEL,HEAD等等

  10. HTTP请求剖析 • Host: download.microtool.de • Host:指定请求资源的Intenet主机和端口号,必须表示请求url的原始服务器或网关的位置。HTTP/1.1请求必须包含主机头域,否则系统会以400状态码返回。

  11. HTTP请求剖析 username=yuannan&password=111111 POST到服务器中的数据。

  12. HTTP请求剖析 • User-Agent: Mozilla/4.04[en](Win95;I;Nav) • User-Agent头域的内容包含发出请求的用户信息。

  13. 典型的HTTP响应 HTTP/1.0 200 OK Date: Mon,31 Dec 2001 04:25:57 GMT Server: Apache/1.3.14(Unix) Content-type: text/html Last-modified: Tue,17 Apr 2001 06:46:28 GMT Etag: "a030f020ac7c01:1e9f" Content-length: 39725426 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head>……

  14. HTTP响应剖析 • HTTP/1.0 200 OK • 协议版本号,状态号

  15. HTTP响应剖析 • Server: Apache/1.3.14(Unix) • 服务器的名称,版本,以及服务器所在的操作系统名称

  16. HTTP响应剖析 • Content-type: text/html • 相应的内容的类型,html文本。

  17. HTTP响应剖析 • Last-modified: Tue,17 Apr 2001 06:46:28 GMT Etag: "a030f020ac7c01:1e9f " • Last-modified文件的最后修改时间,而Etag则是以及文件内容的生成的一个字符序列。通常用于实现客户端缓存,降低服务器压力。当客户端发现请求并没有被修改的话则直接使用本地的缓存。

  18. HTTP响应剖析 • Content-length: 39725426 • 响应内容的长度,单位为Byte。

  19. HTTP响应剖析 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head>…… 浏览器解析的html文本

  20. 观察HTTP协议的两个工具 • HttpWatch, IE插件 • Ethereal, 抓包工具

  21. Apache HTTP Server简介 • The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows NT. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards .

  22. Servlet简介 • Java Servlet technology provides Web developers with a simple, consistent mechanism for extending the functionality of a Web server and for accessing existing business systems. A servlet can almost be thought of as an applet that runs on the server side--without a face. Java servlets make many Web applications possible. • Current version 2.5 • doPost,doGet

  23. JavaServer Pages简介 • JavaServer Pages (JSP) technology provides a simplified, fast way to create dynamic web content. JSP technology enables rapid development of web-based applications that are server- and platform-independent.

  24. Tomcat Servlet/JSP Container简介 • Apache Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process. • Scriptlet,JSTL

  25. 浏览器与服务器交互 POST /login HTTP/1.1 Accept: image/gif, image/x-xbitmap, application/msword, */* Referier: http://www.yahaogroup.com/ Accept-Language: zh-cn username=yuannan&password=123 …… Tomcat 文本流 Request HTTP/1.1 200 OK Date: Mon, 20 Aug 2007 05:48:34 GMT Content-Length: 1100 Content-Type: text/html;charset=UTF-8 Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET <HEAD> <TITLE>成功</TITLE> …… Response 文本流 Servlet

  26. 浏览器与服务器交互(详细) Servlet Request doPost (Request, Response) { //业务处理 //结果输出 … … } ParameterMap key value username yuannan password 123 Host Server 文本流 POST …… username=yuannan&password=123…… Tomcat Response

  27. 浏览器与服务器交互(详细) • HTTP/1.1 200 OK • Date: Mon, 20 Aug 2007 05:48:34 GMT • Content-Length: 1100 • Content-Type: text/html;charset=UTF-8 • Server: Microsoft-IIS/6.0 • X-Powered-By: ASP.NET • <HEAD> • <TITLE>成功</TITLE> …… 文本流

  28. 作业 • 下载J2SE 6及其文档 • 下载Java EE 5 API • 下载Tomcat 6及其文档 • 下载Struts1.2.9及其文档 • 下载Spring 2.5.6及其文档 • 下载Hibernate3.2及其文档 • 下载Eclipse3.2 • 下载JSTL1.1 API

  29. 作业 • 下载HttpWatch,Ethereal并观察Http协议 • 复习今天所讲授的内容

  30. FAQ

  31. 谢谢!

More Related