Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "第一讲 J2EE基础 博和利初级培训 —开发技能."— 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 Windows Linux Max OS X Unix SQL Server MySQL Oracle

4 Struts + Spring + Hibernate
UI Layer Business Layer Persistence Layer Spring Hibernate Struts - MVC Service Locator DAO Classes 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 浏览器将客户端请求(Request)形成符合HTTP协议的 流传递给服务器。
Http协议的简单介绍 HTTP,Hyper Text Transfer Protocol 超文本 传输协议 浏览器将客户端请求(Request)形成符合HTTP协议的 流传递给服务器。 服务器根据客户浏览器的请求进行处理,将结果形 成符合HTTP协议的流,返回给客户端,形成响应 (Response) 请求-响应形成了HTTP协议的基本通信方式 这些形成的流通常是文本流

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

7

8 浏览器与服务器交互 Response Request

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

10 HTTP请求剖析 POST HTTP/1.1 通过POST方法获得指定URL下的文件。 除了POST方法以外,还有GET,DEL,HEAD等等

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

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

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

14 典型的HTTP响应 HTTP/ OK Date: Mon,31 Dec :25:57 GMT Server: Apache/1.3.14(Unix) Content-type: text/html Last-modified: Tue,17 Apr :46:28 GMT Etag: "a030f020ac7c01:1e9f" Content-length: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML Transitional//EN" " <html> <head>……

15 HTTP响应剖析 HTTP/ OK 协议版本号,状态号

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

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

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

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

20 HTTP响应剖析 浏览器解析的html文本
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML Transitional//EN" " <html> <head>…… 浏览器解析的html文本

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

22 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 .

23 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

24 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.

25 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

26 浏览器与服务器交互 POST /login HTTP/1.1
Accept: image/gif, image/x-xbitmap, application/msword, */* Referier: Accept-Language: zh-cn username=yuannan&password=123 …… Tomcat 文本流 Request HTTP/ OK Date: Mon, 20 Aug :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

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

28 浏览器与服务器交互(详细) 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> …… 文本流

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

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

31 FAQ

32 谢谢!


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

Similar presentations


Ads by Google