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

正文內(nèi)容

通過(guò)代碼實(shí)例跟我學(xué)ssh三大框架相互整合的應(yīng)用技術(shù)第3部分——使用spring的actionsupport整合struts和spring的應(yīng)用實(shí)例(已修改)

2024-11-30 07:41 本頁(yè)面
 

【正文】 楊教授工作室 精心創(chuàng)作的優(yōu)秀程序員 職業(yè)提升必讀系列資料 楊教授工作室,版權(quán)所有,盜版必究 , 1/21 頁(yè) 通過(guò)代碼實(shí)例跟我學(xué) SSH 三大框架相互整合的應(yīng)用技術(shù)(第 3 部分) —— 使用 Spring 框架的 ActionSupport 組件 整合 Struts框架和 Spring框架的應(yīng)用實(shí)例 ActionSupport 類 ( 1) 類的主要功能 它為 類的子類,提供如下方面的功能(參考 Spring API文檔說(shuō)明) Convenience class for Springaware Struts + Actions; Provides a reference to the current Spring application context, . for bean lookup or resource loading. Autodetects a ContextLoaderPlugIn context, falling back to the root WebApplicationContext. For typical usage, . accessing middle tier beans, use a root WebApplicationContext. For Struts DispatchActions or Lookup/MappingDispatchActions, use the analogous DispatchActionSupport or LookupDispatchActionSupport / MappingDispatchActionSupport class, respectively. ( 2)繼承關(guān)系 ( 3)實(shí)現(xiàn) 的方法和要求 楊教授工作室 精心創(chuàng)作的優(yōu)秀程序員 職業(yè)提升必讀系列資料 楊教授工作室,版權(quán)所有,盜版必究 , 2/21 頁(yè) 為 了 方 便 地 獲 得 Spring WebContext 環(huán)境,在 類中提供了一個(gè) getWebApplicationContext( protected final WebApplicationContext getWebApplicationContext()) 方法。我們所要做的只是從 Spring 的 ActionSupport 類(而不是 Struts Action 類)擴(kuò)展我們的 Struts 的 Action類。 但這樣一來(lái)在 Action 中,需要取得業(yè)務(wù)邏輯的地方都要 getBean,看上去不夠簡(jiǎn)潔。 ( 4)為什么我們的 Action 類要從 ActionSupport 類繼承 在常規(guī)的方式中,為了能夠在 Struts 的 Action 類中獲得各個(gè) 業(yè)務(wù)組件類的對(duì)象,一般是采用 WebApplicationContextUtils 類從 ServletContext 中獲得 WebApplicationContext 。 另一個(gè)更簡(jiǎn)單的辦法是繼承 Spring 的 Action 類(也就是 ActionSupport 類 ) 因?yàn)?,?ActionSupport 類 中 提供了一些 更加 便利的 getWebApplicationContext()方法 。 public class UserLoginAction extends ActionSupport // extends Action { public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest ServletRequest, HttpServletResponse ServletResponse) { //( 1)使用 getWebApplicationContext() 方法獲得一個(gè) ApplicationContext ApplicationContext applicationContext = getWebApplicationContext()。 //( 2)通過(guò) Spring IoC 容器獲得實(shí)現(xiàn)用戶登錄功能的業(yè)務(wù)組件類 UserLoginBusiness 的 Spring bean BusinessInterface userLoginBusiness = (BusinessInterface) (userLoginBusiness)。 //( 3) 再對(duì)業(yè)務(wù)組件類進(jìn)行訪問(wèn)以完成具體的功能實(shí)現(xiàn) } } ( 5)注意在 Spring 中針對(duì)我們不同的 Action 類提供了對(duì)應(yīng)不同的 ActionSupport Spring 包含了所有標(biāo)準(zhǔn) Struts Action 的子類 Spring 版本在類名末尾附加了 Support: 1) ActionSupport, 楊教授工作室 精心創(chuàng)作的優(yōu)秀程序員 職業(yè)提升必讀系列資料 楊教授工作室,版權(quán)所有,盜版必究 , 3/21 頁(yè) 2) DispatchActionSupport, 3) LookupDispatchActionSupport 4) MappingDispatchActionSupport 將 JBuilder 中所需要的 Spring 的 Jar 包文件庫(kù)加入到本 Project 中 楊教授工作室 精心創(chuàng)作的優(yōu)秀程序員 職業(yè)提升必讀系列資料 楊教授工作室,版權(quán)所有
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
公安備案圖鄂ICP備17016276號(hào)-1