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

正文內(nèi)容

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

2025-01-23 02:24本頁面
  

【正文】 更多細(xì)節(jié)請參見 。 14 當(dāng)然,只有當(dāng) Action處理過程中需要授權(quán)信息的時候,才需要這種集成。 最后一種情況是由第三方類庫來做所有的事情,比如 Acegi。這時就需要寫一個攔截器,用它來進(jìn)行驗證,獲取所需要的角色信息,并組裝信息?,F(xiàn)有的Struts2標(biāo)簽都可以用來進(jìn)行基于角色的訪問限制。 第一種是外部的解決方案,通過 HttpServletRequest來提供用戶帳戶信息。 在 Struts2 Web應(yīng)用的視圖中,需要對用戶是否有權(quán)訪問 URL進(jìn)行驗證。 進(jìn)行授權(quán)的地方: 進(jìn)行驗證的地方: 安全 和數(shù)據(jù)庫集成一樣,在 Struts2中提供安全集成也沒有什么特別的地方。這樣 Hibernate就可以成功的完成延遲加載。 13 附帶說一下,如果你打算在項目中使用 Hibernate作為 ORM技術(shù)的話,那么需要研究一下 ―OpenSessionInView‖過濾器或攔截器。 通過標(biāo)簽庫 ——既然你使用的是基于 Action的框架,所以這并不是最佳的選擇。有興趣的讀者可以參考一下 Spring插件的文檔。 constructor Spring 會通過 bean的構(gòu)造器自動織入 bean。 type Spring在 bean的定義中,使用類名來自動織入bean。 public void setService( MyService service ) { myService = service。 使用 Spring時還有一點要注意的是如何編織依賴關(guān)系。作為默認(rèn)的 DI容器, Spring會獲取所 有依賴對象的實例,并在所需的時候傳給目標(biāo)對象。如果它知道如何創(chuàng)建對象實例的話,那它就會進(jìn)行創(chuàng)建,如果它不知道的話,就會把創(chuàng)建工作交回給框架完成。在下面這種情況下,任何以―applicationContext‖開頭的 XML文件都會被裝載: contextparam paramnamecontextConfigLocation/paramname paramvalueclasspath*:applicationContext*.xml/paramvalue /contextparam 現(xiàn)在你就可以在 Spring的支持下進(jìn)行開發(fā)了。 安裝 Spring支持的時候,需要下載 Spring插件 17,并把它拷貝到 Web應(yīng)用中的―/WEBINF/lib‖目錄下,或者是在 Maven2 ―‖ 構(gòu)建文件中添加對 Spring插件的依賴: dependency groupId/groupId artifactIdstruts2springplugin/artifactId version/version /dependency 在 ―‖配置文件中,你需要添加兩部分代碼。關(guān)于該插件的詳細(xì)信息可以在這里找到: Plexus15 插件是剛剛加入代碼庫的,目前還是被標(biāo)記為 ―試驗性 ‖。 Spring Framework Spring Framework插件是 Struts2推薦使用的依賴注入( DI)或控制反轉(zhuǎn)( IoC)容器,它可以為 Action提供完全配置好的業(yè)務(wù)服務(wù)實例。在Struts2中使用 EJB3有三種方式 ——實現(xiàn)一個自定義的 ObjectFactory,為 Action獲取EJB引用,然后在 ―‖配置文件的 ―‖屬性中加以定義,把這個新的工廠安裝到應(yīng)用程序中;創(chuàng)建一個新的攔截器,用來檢查每一個 Action,并把所需的 EJB應(yīng)用注入其中;或者還可以使用 Spring插件來訪問 JPA或是 EJB, 南。 EJB3,它雖然不是 Ioc容器,但仍可以用來為 Action提供業(yè)務(wù)服務(wù)。所以 Struts2中對 Tiles的支持被標(biāo)記為 ―試驗性 ‖。 action name=my class= result type=tiles/result /action Struts2中使用了 Tiles的第二版。要使用 Tiles布局的 Action結(jié)果都需要把 ―type‖屬性設(shè)置為 ―tiles‖(或者是把 Tiles結(jié)果設(shè)置為默認(rèn)值),并指定要使用的 tile名稱。 Tiles 10 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會從 ―WEBINF‖目錄下載入 ―‖配置文件,該文件中定義了應(yīng)用中的每一個 tile。 filter filternamestrutscleanup/filtername filterclass /filterclass /filter 如果你使用了 Freemarker或者 Velocity來渲染頁面,那么就需要添加下面兩種過濾器之一: filter filternamesitemesh/filtername filterclass /filterclass /filter filter filternamesitemesh/filtername filterclass /filterclass /filter 過濾器映射的順序也非常重要。一種是把插件 13放到應(yīng)用程序下的―/WEBINF/lib‖目錄 中,一種是在 Maven2 ―‖構(gòu)建文件中添加依賴關(guān)系: dependency groupId/groupId artifactIdstruts2sitemeshplugin/artifactId version/version /dependency 在安裝完以后,需要配置 Servlet過濾器。 Struts2中提供了對這兩種布局技術(shù)的集成。 頁面修飾和布局 開發(fā) Web應(yīng)用通常都意味著要有一個標(biāo)準(zhǔn)的頁面布局,并被應(yīng)用到整個應(yīng)用中,并且不同的模塊,頁面和向?qū)Э赡苓€要使用額外的一些布局。如果你沒有從中找到想要的信息,那么可以檢查一下幾個月前的更新,也許它已經(jīng)被添加進(jìn)來了。本章也并不旨在說明如何使用那些用于集成的類庫,但是假定讀者已經(jīng)有了相關(guān)的基礎(chǔ)知識。 插件擴(kuò)展點 ——Struts2中, 可以用新的核心框架類的實現(xiàn)來進(jìn)行替換,從而改變框架的行為。 插件包 ——新的攔截器,結(jié)果類型,結(jié)果和 Action可以被打包到插件里面,以便在多個項目中重用。 下面我 們再來復(fù)習(xí)一下,它們包括: At the business service level – each method on a business service may be required to determine access levels before performing logic At the subpage level – there may be certain sections of a page can only be viewed, modified or have action performed for particular access levels Within the application – via a HTML form or another type of challengeresponse mechanism Authorization can occur: the business service, like the previous options, are injected into the action by the dependency injection framework 6 As a side note, if you are thinking about utilizing Hibernate as an ORM technology on your project, investigate the ―OpenSessionInView‖ filter or interceptor. Having the Hibernate session open until the rendering of the JSP is plete allows Hibernate to perform lazyloading fetches to the database successfully. Otherwise, the action or business service or DAO would need to prefetch all the collections that the JSP needs ahead of time. Security Like database integration, there is nothing special that provides security integration in Struts2. It is up to the application architect or developer to decide at which layers in the infrastructure or application authorization and authentication occu
點擊復(fù)制文檔內(nèi)容
范文總結(jié)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1