




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、J2EE考點(diǎ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 是通過容器管理的,容器對每層提供什么服務(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模式以及其他定制通過此注冊名而不是類名引用此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)建一個新的會話對象(Httpsession), Server分配一個唯一的會話標(biāo)識號(sessionID);Servlet容器自動處理sessionID的分配盡可能長,確保安全把sessionID信息放到HttpSession對象中2、Server創(chuàng)建一個暫時的HTTP cookiecookie存儲這個sessionID(名:jsessionid)Server將cookie添加到HTTP響應(yīng)中Cookie被放置到客戶機(jī)瀏覽器中,存儲到客戶機(jī)硬盤 客戶瀏覽器發(fā)送包含Cookie的請求;4、根據(jù)客戶
15、機(jī)瀏覽器發(fā)送的sessionID信息(cookie),Server找到相應(yīng)的HttpSession對象,跟蹤會話5、在會話超時間隔期間,如果沒有接收到新的請求, Server將刪除此會話對象用戶又訪問該站點(diǎn),必須重新注冊,確保安全 Cookie被客戶禁用時,采用URL重寫機(jī)制:調(diào)用reponse.encodeURL(URL)方法;http:/;jsessionid=.1、5與Cookie機(jī)制相同2、Server將sessionID放在返回給客戶端的URL中;3、客戶瀏覽器發(fā)送的請求將包含sessionID; 4、根據(jù)包含請求的sessionID信息(URL),Server找到相應(yīng)的HttpSe
16、ssion對象,跟蹤會話Tomcat組織結(jié)構(gòu),里面的xml看一下,給一個請求,它如何處理Server 代表一個服務(wù)器,可包含多個Service 可包含一個Engine,多個Connector 代表通信接口 可包含多個Host 可包含多個Context HYPERLINK http:/localhost:8080/HelloServlet/ http:/localhost:8080/ HYPERLINK http:/localhost:8080/HelloServlet/ HelloServlet HYPERLINK http:/localhost:8080/HelloServlet/ / 1.
17、請求被發(fā)送到本機(jī)端口8080,被Coyote Http/1.1 Connector獲得;2. Connector將該請求交給它所在的Service的Engine來處理,并等待Engine的回應(yīng);3. Engine獲得請求,匹配所有虛擬主機(jī);4. Engine匹配到名為localhost的主機(jī);5. localhost主機(jī)獲得請求,匹配所擁有的所有Context;6. localhost主機(jī)匹配到路徑為/HelloServlet的Context;cookie,session的應(yīng)用場景過濾器、監(jiān)聽器的應(yī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)換、加密動態(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)簽庫)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),動態(tài)(JSP元素)JSP元素有哪些JSP指令有哪些JSP腳本元
21、素有哪些JSP隱式對象有哪些JSP有哪些作用域?qū)ο驤SP動作:include,forward動作JSP動作與重定向差別不考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)用場景
23、web前端為顧客訂貨錄入系統(tǒng)倉庫管理系統(tǒng):接受訂單、配送貨品、把訂單轉(zhuǎn)交發(fā)貨系統(tǒng)發(fā)貨系統(tǒng):更新顧客的賬號紀(jì)錄,開始發(fā)貨異步傳遞消息JMS兩種消息域:點(diǎn)對點(diǎn),發(fā)布訂閱,他們的應(yīng)用場景點(diǎn)對點(diǎn)消息傳送1 多個生成方可向一個隊(duì)列發(fā)送消息。生成方可共享連接或使用不同連接,但它們均可訪問同一隊(duì)列2 多個接收者可使用一個隊(duì)列中的消息,但每條消息只能由一個接收者使用。3 接收者可共享連接或使用不同連接,但它們均可訪問同一隊(duì)列4 發(fā)送者和接收者之間不存在時間上的相關(guān)性5 可在運(yùn)行時動態(tài)添加和刪除發(fā)送者和接收者,即可根據(jù)需要擴(kuò)展或收縮消息傳送系統(tǒng)6 消息在隊(duì)列中的放置順序與發(fā)送順序相同,但它們的使用順序則取決于消
24、息失效期、消息優(yōu)先級以及使用消息時是否使用選擇器等因素發(fā)布/ 訂閱消息傳送1 多個生成方可向一個主題發(fā)布消息。生成方可共享連接或使用不同連接,但它們均可訪問同一主題2 多個訂戶可使用一個主題中的消息。訂戶可檢索發(fā)布到一個主題中所有消息訂戶可共享連接或使用不同連接,但它們均可訪問同一主題。3 長期訂戶可能處于活動狀態(tài),也可能處于非活動狀態(tài)。在它們處于非活動狀態(tài)時,代理會為它們保留消息4 可在運(yùn)行時動態(tài)添加和刪除發(fā)布者和訂戶,這樣,即可根據(jù)需要擴(kuò)展或收縮消息傳送系統(tǒng)。消息發(fā)布到主題的順序與發(fā)送順序相同,但它們的使用順序則取決于消息失效期、消息優(yōu)先級以及使用消息時是否使用選擇器等因素5 發(fā)布者與訂戶之間存在時間上的相關(guān)性:主題訂戶只能使用在它創(chuàng)建訂閱后發(fā)布的消息JMS消費(fèi)者:同步,異步 之間的差別消息的傳遞是異步的,客戶機(jī)程序在消息到達(dá)之前,可以做其他事情。receive()方法:如果有可用的消息,返回這個消息,否則將一直等待receiveNoWait()方法:如果有可用的消息,返回這個消息,否則返回NULLreceive(long timeout)方法:根據(jù)給定的超時參數(shù)制定的時間等待一個消息的到來,如果在這個時間之內(nèi)有可用的消息,返回這個消息,如果超時后仍沒有可用的消息,返回NULLJ2EE容器提供聲明性安全和編程性安全Declarative
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 遼寧金融職業(yè)學(xué)院《中國現(xiàn)當(dāng)代文學(xué)(四)》2023-2024學(xué)年第一學(xué)期期末試卷
- 新型服裝創(chuàng)業(yè)培訓(xùn)課件
- 未來十年內(nèi)新能源發(fā)展趨勢預(yù)測
- 綠色能源領(lǐng)域的可持續(xù)發(fā)展與生物質(zhì)能源行業(yè)標(biāo)準(zhǔn)研究
- 護(hù)理三基??荚囶}含答案
- 人工智能智能客服系統(tǒng)企業(yè)制定與實(shí)施新質(zhì)生產(chǎn)力項(xiàng)目商業(yè)計(jì)劃書
- 外研版九年級英語上冊Module-11-達(dá)標(biāo)測試卷附答案
- 人教版八年級物理1.2運(yùn)動的描述同步測試題(附答案)
- 2024年中國工商銀行寧夏銀川支行春季校招筆試題帶答案
- 高二2025春期期末政治練習(xí)及答案
- T∕CITS 146-2024 尿液有形成分名稱與結(jié)果報(bào)告規(guī)范化指南
- 農(nóng)藥經(jīng)營考試題及答案
- 2025年中考安徽物理試題及答案
- 標(biāo)前合作合同范本
- 2025年初級鋼筋工(五級)技能認(rèn)定理論考試指導(dǎo)題庫(含答案)
- 國家開放大學(xué)漢語言文學(xué)本科《古代詩歌散文專題》期末紙質(zhì)考試第四大題論述題庫2025春期版
- 2024秋新科粵版化學(xué)九年級上冊教學(xué)課件 2.2 構(gòu)成物質(zhì)的微觀粒子 第4課時 相對原子質(zhì)量 離子的形成
- 魅力溝通技巧課件
- 寵物店合伙協(xié)議書范本
- 國家開放大學(xué)法律事務(wù)??啤睹穹▽W(xué)(1)》期末紙質(zhì)考試總題庫2025春期考試版
- 2025年度資料員勞動合同范本(含試用期管理規(guī)定)
評論
0/150
提交評論