freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

計(jì)算機(jī)專業(yè)畢業(yè)設(shè)計(jì)外文文獻(xiàn)翻譯部分-其他專業(yè)(文件)

2025-02-12 02:24 上一頁面

下一頁面
 

【正文】 Apache Tiles和 SiteMesh一樣,都可以把插件 14放到 Web應(yīng)用的 ―/WEBINF/lib‖目錄下,或是在 Mave2 ―‖文件中加入依賴: dependency groupId/groupId artifactIdstruts2tilesplugin/artifactId version/version /dependency 我們需要配置 Servlet Listener才能載入 tiles配置信息: listener listenerclass /listenerclass /listener Listener會(huì)從 ―WEBINF‖目錄下載入 ―‖配置文件,該文件中定義了應(yīng)用中的每一個(gè) tile。 action name=my class= result type=tiles/result /action Struts2中使用了 Tiles的第二版。 EJB3,它雖然不是 Ioc容器,但仍可以用來為 Action提供業(yè)務(wù)服務(wù)。 Spring Framework Spring Framework插件是 Struts2推薦使用的依賴注入( DI)或控制反轉(zhuǎn)( IoC)容器,它可以為 Action提供完全配置好的業(yè)務(wù)服務(wù)實(shí)例。關(guān)于該插件的詳細(xì)信息可以在這里找到: 在下面這種情況下,任何以―applicationContext‖開頭的 XML文件都會(huì)被裝載: contextparam paramnamecontextConfigLocation/paramname paramvalueclasspath*:applicationContext*.xml/paramvalue /contextparam 現(xiàn)在你就可以在 Spring的支持下進(jìn)行開發(fā)了。作為默認(rèn)的 DI容器, Spring會(huì)獲取所 有依賴對象的實(shí)例,并在所需的時(shí)候傳給目標(biāo)對象。 public void setService( MyService service ) { myService = service。 constructor Spring 會(huì)通過 bean的構(gòu)造器自動(dòng)織入 bean。 通過標(biāo)簽庫 ——既然你使用的是基于 Action的框架,所以這并不是最佳的選擇。 13 附帶說一下,如果你打算在項(xiàng)目中使用 Hibernate作為 ORM技術(shù)的話,那么需要研究一下 ―OpenSessionInView‖過濾器或攔截器。 安全 和數(shù)據(jù)庫集成一樣,在 Struts2中提供安全集成也沒有什么特別的地方。 在 Struts2 Web應(yīng)用的視圖中,需要對用戶是否有權(quán)訪問 URL進(jìn)行驗(yàn)證?,F(xiàn)有的Struts2標(biāo)簽都可以用來進(jìn)行基于角色的訪問限制。 最后一種情況是由第三方類庫來做所有的事情,比如 Acegi。 更多細(xì)節(jié)請參見 。 14 當(dāng)然,只有當(dāng) Action處理過程中需要授權(quán)信息的時(shí)候,才需要這種集成。這時(shí)就需要寫一個(gè)攔截器,用它來進(jìn)行驗(yàn)證,獲取所需要的角色信息,并組裝信息。 第一種是外部的解決方案,通過 HttpServletRequest來提供用戶帳戶信息。 進(jìn)行授權(quán)的地方: 進(jìn)行驗(yàn)證的地方: 這樣 Hibernate就可以成功的完成延遲加載。 有興趣的讀者可以參考一下 Spring插件的文檔。 type Spring在 bean的定義中,使用類名來自動(dòng)織入bean。 使用 Spring時(shí)還有一點(diǎn)要注意的是如何編織依賴關(guān)系。如果它知道如何創(chuàng)建對象實(shí)例的話,那它就會(huì)進(jìn)行創(chuàng)建,如果它不知道的話,就會(huì)把創(chuàng)建工作交回給框架完成。 安裝 Spring支持的時(shí)候,需要下載 Spring插件 17,并把它拷貝到 Web應(yīng)用中的―/WEBINF/lib‖目錄下,或者是在 Maven2 ―‖ 構(gòu)建文件中添加對 Spring插件的依賴: dependency groupId/groupId artifactIdstruts2springplugin/artifactId version/version /dependency 在 ―‖配置文件中,你需要添加兩部分代碼。 Plexus15 插件是剛剛加入代碼庫的,目前還是被標(biāo)記為 ―試驗(yàn)性 ‖。在Struts2中使用 EJB3有三種方式 ——實(shí)現(xiàn)一個(gè)自定義的 ObjectFactory,為 Action獲取EJB引用,然后在 ―‖配置文件的 ―‖屬性中加以定義,把這個(gè)新的工廠安裝到應(yīng)用程序中;創(chuàng)建一個(gè)新的攔截器,用來檢查每一個(gè) Action,并把所需的 EJB應(yīng)用注入其中;或者還可以使用 Spring插件來訪問 JPA或是 EJB, 南。所以 Struts2中對 Tiles的支持被標(biāo)記為 ―試驗(yàn)性 ‖。要使用 Tiles布局的 Action結(jié)果都需要把 ―type‖屬性設(shè)置為 ―tiles‖(或者是把 Tiles結(jié)果設(shè)置為默認(rèn)值),并指定要使用的 tile名稱。 filter filternamestrutscleanup/filtername filterclass /filterclass /filter 如果你使用了 Freemarker或者 Velocity來渲染頁面,那么就需要添加下面兩種過濾器之一: filter filternamesitemesh/filtername filterclass /filterclass /filter filter filternamesitemesh/filtername filterclass /filterclass /filter 過濾器映射的順序也非常重要。 Struts2中提供了對這兩種布局技術(shù)的集成。如果你沒有從中找到想要的信息,那么可以檢查一下幾個(gè)月前的更新,也許它已經(jīng)被添加進(jìn)來了。 插件擴(kuò)展點(diǎn) ——Struts2中, 可以用新的核心框架類的實(shí)現(xiàn)來進(jìn)行替換,從而改變框架的行為。 At the business service level – each method on a business service may be required to determine access levels before performing logic Within the application – via a HTML form or another type of challengeresponse mechanism Authorization can occur: when the action is ready for the business logic to be executed, all the necessary data access object instances are ready to go Custom DAOs via Dependency Injection – if you are using dependency inject, you can take advantage of the library to inject in your custom data access objects (DAO) that are required in the action。 public void setService( MyService service ) { myService = service。 however the implementation would be simple. There are three options available – implement a custom ObjectFactory to obtain EJB references for actions and install the new factory in your web application using the ―‖ property in the ―‖ configuration file。 Plugin extensions points – allows new implementations of the core framework classes to be substituted in to Struts2, thus changing the way the framework behaves. The goal of this chapter is not to describe every and each of the integration options in detail, but rather to provide a brief overview to what types of integrations are possible, how the integration is achieved, some basic configuration information and where to find more information. This chapter is also not intended to provide information on how to use the library used for integration, but assumes that the reader understands the functionality already. Uptodate information regarding all integrations (Apache and 3rd party) can be found on the Struts2 wiki at New projects are constan
點(diǎn)擊復(fù)制文檔內(nèi)容
范文總結(jié)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1