J2EE考點(diǎn)資料_第1頁(yè)
J2EE考點(diǎn)資料_第2頁(yè)
J2EE考點(diǎn)資料_第3頁(yè)
J2EE考點(diǎn)資料_第4頁(yè)
J2EE考點(diǎn)資料_第5頁(yè)
已閱讀5頁(yè),還剩2頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、J2EE考點(diǎn)(簡(jiǎn)答題,問答題)概述J2EE是分布式的,多層的框架,有哪些層?每層有哪些組件?Client-tier components run on the client machineweb client/thin client: dynamic web pages containing various types of markup language (HTML, XML, and so on)Applets application client: typically has a graphical user interface (GUI) created from the Swing

2、or the Abstract Window Toolkit (AWT) APIThe JavaBeansTM Component Architecture Web-tier components run on the Java EE serverJava Servlet, JavaServer Faces, and JavaServer PagesTM (JSPTM) Business-tier components run on the Java EE serverEnterprise JavaBeansTM (EJBTM) Enterprise information system (E

3、IS)-tier software runs on the EIS serverenterprise infrastructure systems such as enterprise resource planning (ERP), mainframe transaction processing, database systems, and other legacy information systems 是通過容器管理的,容器對(duì)每層提供什么服務(wù)?The Java EE security model lets you configure a web component or enterpr

4、ise bean so that system resources are accessed only by authorized users.The Java EE transaction model lets you specify relationships among methods that make up a single transaction so that all methods in one transaction are treated as a single unit.JNDI lookup services provide a unified interface to

5、 multiple naming and directory services in the enterprise so that application components can access these services.The Java EE remote connectivity model manages low-level communications between clients and enterprise beans. After an enterprise bean is created, a client invokes methods on it as if it

6、 were in the same virtual machineJ2EE有哪些開發(fā)角色?The Java EE product providerdesigns and makes available for purchase the Java EE platform APIs, and other features defined in the Java EE specification. typically application server vendors who implement the Java EE platform according to the Java EE 5 Pla

7、tform specification.The tool providercreates development, assembly, and packaging tools used by component providers, assemblers, and deployers.Application Component Providercreates web components, enterprise beans, applets, or application clients for use in Java EE applications.Application Assembler

8、 receives application modules from component providers and assembles them into a Java EE application EAR file.Application Deployer and Administrator configures and deploys the Java EE application, administers the computing and networking infrastructure where Java EE applications run, and oversees th

9、e runtime environment.ServletServlet生命周期The life cycle of a servlet is controlled by the container in which the servlet has been deployed.When a request is mapped to a servlet, the container performs the following steps.1. If an instance of the servlet does not exist, the web containera. Loads the s

10、ervlet class.b. Creates an instance of the servlet class.c. Initializes the servlet instance by calling the init method. 2. Invokes the service method, passing request and response objects. If the container needs to remove the servlet, it finalizes the servlet by calling the servlets destroy method.

11、 容器提供哪些服務(wù)A web container provides services such as request dispatching, security, concurrency, and life-cycle management. It also gives web components access to APIs such as naming, transactions, and email.URL組成部分 HYPERLINK http:/host:portrequest-path?query-string http:/host:portrequest-path?query-s

12、tringThe request path is further composed of the following elements:Context path: A concatenation of a forward slash (/) with the context root of the servlets web application.Servlet path: The path section that corresponds to the component alias that activated this request. This path starts with a f

13、orward slash (/).Path info: The part of the request path that is not part of the context path or the servlet path.Web.xml常用標(biāo)簽*servlet-name的含義首先,初始化參數(shù)、定制的URL模式以及其他定制通過此注冊(cè)名而不是類名引用此servlet 其次,可在URL而不是類名中使用此名稱可使用http:/host:port/webAppPrefix/Hello代替http:/host:port/webAppPrefix/servlet.HelloServlet (以Tomc

14、at為例)Session兩種實(shí)現(xiàn):URL重寫,cookies 分別怎么實(shí)現(xiàn)1、當(dāng)用戶第一次訪問站點(diǎn)創(chuàng)建一個(gè)新的會(huì)話對(duì)象(Httpsession), Server分配一個(gè)唯一的會(huì)話標(biāo)識(shí)號(hào)(sessionID);Servlet容器自動(dòng)處理sessionID的分配盡可能長(zhǎng),確保安全把sessionID信息放到HttpSession對(duì)象中2、Server創(chuàng)建一個(gè)暫時(shí)的HTTP cookiecookie存儲(chǔ)這個(gè)sessionID(名:jsessionid)Server將cookie添加到HTTP響應(yīng)中Cookie被放置到客戶機(jī)瀏覽器中,存儲(chǔ)到客戶機(jī)硬盤 客戶瀏覽器發(fā)送包含Cookie的請(qǐng)求;4、根據(jù)客戶

15、機(jī)瀏覽器發(fā)送的sessionID信息(cookie),Server找到相應(yīng)的HttpSession對(duì)象,跟蹤會(huì)話5、在會(huì)話超時(shí)間隔期間,如果沒有接收到新的請(qǐng)求, Server將刪除此會(huì)話對(duì)象用戶又訪問該站點(diǎn),必須重新注冊(cè),確保安全 Cookie被客戶禁用時(shí),采用URL重寫機(jī)制:調(diào)用reponse.encodeURL(URL)方法;http:/;jsessionid=.1、5與Cookie機(jī)制相同2、Server將sessionID放在返回給客戶端的URL中;3、客戶瀏覽器發(fā)送的請(qǐng)求將包含sessionID; 4、根據(jù)包含請(qǐng)求的sessionID信息(URL),Server找到相應(yīng)的HttpSe

16、ssion對(duì)象,跟蹤會(huì)話Tomcat組織結(jié)構(gòu),里面的xml看一下,給一個(gè)請(qǐng)求,它如何處理Server 代表一個(gè)服務(wù)器,可包含多個(gè)Service 可包含一個(gè)Engine,多個(gè)Connector 代表通信接口 可包含多個(gè)Host 可包含多個(gè)Context HYPERLINK http:/localhost:8080/HelloServlet/ http:/localhost:8080/ HYPERLINK http:/localhost:8080/HelloServlet/ HelloServlet HYPERLINK http:/localhost:8080/HelloServlet/ / 1.

17、請(qǐng)求被發(fā)送到本機(jī)端口8080,被Coyote Http/1.1 Connector獲得;2. Connector將該請(qǐng)求交給它所在的Service的Engine來處理,并等待Engine的回應(yīng);3. Engine獲得請(qǐng)求,匹配所有虛擬主機(jī);4. Engine匹配到名為localhost的主機(jī);5. localhost主機(jī)獲得請(qǐng)求,匹配所擁有的所有Context;6. localhost主機(jī)匹配到路徑為/HelloServlet的Context;cookie,session的應(yīng)用場(chǎng)景過濾器、監(jiān)聽器的應(yīng)用場(chǎng)景Applications of filters include authenticatio

18、n, logging, image conversion, data compression, encryption, tokenizing streams, XML transformations, and so on. 代碼重用應(yīng)用安全策略日志為特定目標(biāo)瀏覽器傳輸XML輸出圖像轉(zhuǎn)換、加密動(dòng)態(tài)壓縮輸出monitor and react to events in a servlets life cycle by defining listener objects whose methods get invoked when life-cycle events occurJSP(不考表達(dá)式語言和

19、標(biāo)準(zhǔn)標(biāo)簽庫(kù))JSP生命周期A JSP page services requests as a servlet. Thus, the life cycle and many of the capabilities of JSP pages (in particular the dynamic aspects) are determined by Java Servlet technology.When a request is mapped to a JSP page, the web container first checks whether the JSP pages servlet is

20、 older than the JSP page. If the servlet is older, the web container translates the JSP page into a servlet class and compiles the class. During development, one of the advantages of JSP pages over servlets is that the build process is performed automatically兩種部分組成:靜態(tài),動(dòng)態(tài)(JSP元素)JSP元素有哪些JSP指令有哪些JSP腳本元

21、素有哪些JSP隱式對(duì)象有哪些JSP有哪些作用域?qū)ο驤SP動(dòng)作:include,forward動(dòng)作JSP動(dòng)作與重定向差別不考JDBCMVC控制流程1. Client makes a request (Web browser).2. Servlet gets the clients request.3. Servlet determines which program elements (JavaBeans, EJBs or other objects) are required to carry out the specified request.4. JavaBeans or EJBs per

22、form the business logic operations for the servlet, and encapsulate the results.5. Servlet selects a presentation template (JSP) for delivering the content back to the client.6. The JSP generates a specific response by accessing the resultant content available through the JavaBeans.JMS、Java Mail應(yīng)用場(chǎng)景

23、web前端為顧客訂貨錄入系統(tǒng)倉(cāng)庫(kù)管理系統(tǒng):接受訂單、配送貨品、把訂單轉(zhuǎn)交發(fā)貨系統(tǒng)發(fā)貨系統(tǒng):更新顧客的賬號(hào)紀(jì)錄,開始發(fā)貨異步傳遞消息JMS兩種消息域:點(diǎn)對(duì)點(diǎn),發(fā)布訂閱,他們的應(yīng)用場(chǎng)景點(diǎn)對(duì)點(diǎn)消息傳送1 多個(gè)生成方可向一個(gè)隊(duì)列發(fā)送消息。生成方可共享連接或使用不同連接,但它們均可訪問同一隊(duì)列2 多個(gè)接收者可使用一個(gè)隊(duì)列中的消息,但每條消息只能由一個(gè)接收者使用。3 接收者可共享連接或使用不同連接,但它們均可訪問同一隊(duì)列4 發(fā)送者和接收者之間不存在時(shí)間上的相關(guān)性5 可在運(yùn)行時(shí)動(dòng)態(tài)添加和刪除發(fā)送者和接收者,即可根據(jù)需要擴(kuò)展或收縮消息傳送系統(tǒng)6 消息在隊(duì)列中的放置順序與發(fā)送順序相同,但它們的使用順序則取決于消

24、息失效期、消息優(yōu)先級(jí)以及使用消息時(shí)是否使用選擇器等因素發(fā)布/ 訂閱消息傳送1 多個(gè)生成方可向一個(gè)主題發(fā)布消息。生成方可共享連接或使用不同連接,但它們均可訪問同一主題2 多個(gè)訂戶可使用一個(gè)主題中的消息。訂戶可檢索發(fā)布到一個(gè)主題中所有消息訂戶可共享連接或使用不同連接,但它們均可訪問同一主題。3 長(zhǎng)期訂戶可能處于活動(dòng)狀態(tài),也可能處于非活動(dòng)狀態(tài)。在它們處于非活動(dòng)狀態(tài)時(shí),代理會(huì)為它們保留消息4 可在運(yùn)行時(shí)動(dòng)態(tài)添加和刪除發(fā)布者和訂戶,這樣,即可根據(jù)需要擴(kuò)展或收縮消息傳送系統(tǒng)。消息發(fā)布到主題的順序與發(fā)送順序相同,但它們的使用順序則取決于消息失效期、消息優(yōu)先級(jí)以及使用消息時(shí)是否使用選擇器等因素5 發(fā)布者與訂戶之間存在時(shí)間上的相關(guān)性:主題訂戶只能使用在它創(chuàng)建訂閱后發(fā)布的消息JMS消費(fèi)者:同步,異步 之間的差別消息的傳遞是異步的,客戶機(jī)程序在消息到達(dá)之前,可以做其他事情。receive()方法:如果有可用的消息,返回這個(gè)消息,否則將一直等待receiveNoWait()方法:如果有可用的消息,返回這個(gè)消息,否則返回NULLreceive(long timeout)方法:根據(jù)給定的超時(shí)參數(shù)制定的時(shí)間等待一個(gè)消息的到來,如果在這個(gè)時(shí)間之內(nèi)有可用的消息,返回這個(gè)消息,如果超時(shí)后仍沒有可用的消息,返回NULLJ2EE容器提供聲明性安全和編程性安全Declarative

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論