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

正文內(nèi)容

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

2024-11-18 07:41本頁面
  

【正文】 。 因?yàn)椋?如果 我們 想替換掉 Spring,那么 我們 必須重寫代碼。 1點(diǎn)評(píng) 這種技術(shù)很簡單并且易于理解。 ? 在某個(gè) Action 類中提供一個(gè) getServletContextInAction() public getServletContextInAction() { return ()。 ? ContextLoaderPlugIn 的內(nèi)部實(shí)現(xiàn) 通過查看 ContextLoaderPlugIn 的源碼,我們可以發(fā)現(xiàn),原來 ContextLoaderPlugIn 仍然是把 WebApplicationContext 放在 ServletContext 中,只是這個(gè) KEY 不太一樣了,這個(gè) KEY值為 +()(具體請(qǐng)查看源代碼)。 楊教授工作室 精心創(chuàng)作的優(yōu)秀程序員 職業(yè)提升必讀系列資料 楊教授工作室,版權(quán)所有,盜版必究 , 21/21 頁 ( 2)如何在 Struts 的其它組件類特別是在業(yè)務(wù)組件類中獲得 WebApplicationContext 對(duì)象 ? 獲得 WebApplicationContext 對(duì)象 如果我們有些程序是脫離 Struts 的 Action 環(huán)境,我們?cè)趺刺幚怼? } return okOrNot。(1234)) //實(shí)際改變?yōu)樵L問數(shù)據(jù)庫中的表,請(qǐng)見后面的 Hibernate 技術(shù) { okOrNot=true。 if((yang)amp。 String userName=()。 } } } 編程實(shí)現(xiàn)用戶登錄功能的業(yè)務(wù)處理組件類 UserLoginBusiness 中的 doBusiness()方法 package strutsspringweb。 楊教授工作室 精心創(chuàng)作的優(yōu)秀程序員 職業(yè)提升必讀系列資料 楊教授工作室,版權(quán)所有,盜版必究 , 18/21 頁 if ((oneUserInfo)) //實(shí)際改變?yōu)樵L問數(shù)據(jù)庫中的表,請(qǐng)見后面的 Hibernate 技術(shù) { return ((loginSuccess))。 (userName)。 //(3) 通過 Spring IoC 容器獲得實(shí)現(xiàn)用戶登錄功能的業(yè)務(wù)組件類 UserLoginBusiness 的 Spring bean BusinessInterface userLoginBusiness = (BusinessInterface) (userLoginBusiness)。 String userPassword = (()).trim()。 //( 1)通過從 Spring 的 ActionSupport 類而不是 Struts 的 Action 類進(jìn)行擴(kuò)展 public class UserLoginAction extends ActionSupport // extends Action { public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest ServletRequest, HttpServletResponse ServletResponse) { UserLoginForm userLoginForm = (UserLoginForm) actionForm。 import 。 import .*。 } 楊教授工作室 精心創(chuàng)作的優(yōu)秀程序員 職業(yè)提升必讀系列資料 楊教授工作室,版權(quán)所有,盜版必究 , 17/21 頁 } 改寫前面的 UserLoginAction 類以從 類來繼承 ( 1)主要實(shí)現(xiàn)的要求 我們只要把自己的 Action 繼承自 ActionSupport,就 是可以調(diào)用 ActionSupport 中g(shù)etWebApplicationContext()的方法取出 WebApplicationContext。 } public String getRegisterTime(){ return registerTime。 } public int getUserKind(){ return userKind。 } public boolean isUserSex(){ return userSex。 } public int getUserAge(){ return userAge。 } 楊教授工作室 精心創(chuàng)作的優(yōu)秀程序員 職業(yè)提升必讀系列資料 楊教授工作室,版權(quán)所有,盜版必究 , 16/21 頁 public String getUserPassword(){ return userPassword。 public UserInfo() { } public String getUserName(){ return userName。 private int userKind。 private int userAge。 public class UserInfo implements Serializable{ private String userName。
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1