锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲人成电影在线天堂,亚洲妇女水蜜桃av网网站,jlzzjlzz亚洲乱熟在线播放http://m.tkk7.com/forgood/category/36541.html浠庤繖閲屽嚭鍙?/description>zh-cnMon, 08 Dec 2008 09:57:29 GMTMon, 08 Dec 2008 09:57:29 GMT60Spring鍜孲truts鏁村悎鐨勪笁縐嶆柟寮?/title><link>http://m.tkk7.com/forgood/archive/2008/12/08/245062.html</link><dc:creator>forgood</dc:creator><author>forgood</author><pubDate>Mon, 08 Dec 2008 09:00:00 GMT</pubDate><guid>http://m.tkk7.com/forgood/archive/2008/12/08/245062.html</guid><wfw:comment>http://m.tkk7.com/forgood/comments/245062.html</wfw:comment><comments>http://m.tkk7.com/forgood/archive/2008/12/08/245062.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/forgood/comments/commentRss/245062.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/forgood/services/trackbacks/245062.html</trackback:ping><description><![CDATA[<p>1錛屼嬌鐢⊿pring 鐨?ActionSupport </p> <p>2錛屼嬌鐢⊿pring 鐨?DelegatingRequestProcessor 綾匯?/p> <p>3錛屽叏鏉冨鎵樸?br /> </p> <p>鏃犺鐢ㄩ偅縐嶆柟娉曟潵鏁村悎絎竴姝ュ氨鏄涓簊truts鏉ヨ杞絪pring鐨勫簲鐢ㄧ幆澧冦?灝辨槸鍦?struts 涓姞鍏ヤ竴涓彃浠躲?/p> <p>struts-config.xml涓?/p> <table cellspacing="0" bordercolordark="#ffffff" cellpadding="2" width="400" align="center" bordercolorlight="#999999" border="1"> <tbody> <tr> <td class="code" bgcolor="#e6e6e6"> <pre>錛減lug-in className="org.springframework.web.struts.ContextLoaderPlugIn"錛? 錛渟et-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml"/錛? 錛?plug-in錛?/pre> </td> </tr> </tbody> </table> <p>spring 鐨勯厤緗枃浠惰浣滀負(fù)鍙傛暟閰嶇疆榪涙潵銆傝繖鏍峰彲浠ョ渷鐣ュweb.xml 鏂囦歡涓殑閰嶇疆銆傜‘淇濅綘鐨刟pplicationContext.xml 鍦╓EB-INF鐩綍涓嬮潰</p> <p><strong>1銆佷嬌鐢⊿pring鐨凙ctionSupport .</strong> </p> <p><span style="color: red">Spring 鐨凙ctionSupport 緇ф壙鑷硂rg.apache.struts.action.Action</span></p> <p><span style="color: red">ActionSupport鐨勫瓙綾誨彲浠ユ垨寰?WebApplicationContext綾誨瀷鐨勫叏灞鍙橀噺銆傞氳繃getWebApplicationContext錛堬級(jí)鍙互鑾峰緱榪欎釜鍙橀噺銆?/span><br /> </p> <p><br /> 榪欐槸涓涓?servlet 鐨勪唬鐮侊細(xì)</p> <table cellspacing="0" bordercolordark="#ffffff" cellpadding="2" width="400" align="center" bordercolorlight="#999999" border="1"> <tbody> <tr> <td class="code" bgcolor="#e6e6e6"> <pre>public class LoginAction extends org.springframework.web.struts.ActionSupport { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { LoginForm loginForm = (LoginForm) form;// TODO Auto-generated method stub //鑾峰緱 WebApplicationContext 瀵硅薄 WebApplicationContext ctx = this.getWebApplicationContext(); LoginDao dao = (LoginDao) ctx.getBean("loginDao"); User u = new User(); u.setName(loginForm.getName()); u.setPwd(loginForm.getPwd()); if(dao.checkLogin(u)){ return mapping.findForward("success"); }else{ return mapping.findForward("error"); } } } applicationContext.xml 涓殑閰嶇疆 錛渂eans錛? 錛渂ean id="loginDao" class="com.cao.dao.LoginDao"/錛? 錛?beans錛? </pre> </td> </tr> </tbody> </table> <p>榪欎腑閰嶇疆鏂瑰紡鍚岀洿鎺ュ湪web.xml鏂囦歡閰嶇疆宸埆涓嶅ぇ銆?br /> <br /> 娉ㄦ剰錛欰ction緇ф壙鑷?org.springframework.web.struts.ActionSupport 浣垮緱struts鍜宻pring鑰﹀悎鍦ㄤ竴璧楓?/p> <p>浣嗗疄鐜頒簡琛ㄧず灞傚拰涓氬姟閫昏緫灞傜殑瑙h︼紙LoginDao dao = 錛圠oginDao錛?ctx.getBean錛?loginDao"錛夛級(jí)銆?br /> </p> <p><strong><br /> 2銆佷嬌鐢⊿pring 鐨?DelegatingRequestProcessor 綾?/strong></p> <p><span style="color: red">DelegatingRequestProcessor  緇ф壙鑷?org.apache.struts.action.RequestProcessor 騫惰鐩栦簡閲岄潰鐨勬柟娉曘?/span></p> <p><span style="color: red">sturts-config.xml  涓?/span>  <controller < p> <p><span style="color: red">processorClass="org.springframework.web.struts.DelegatingRequestProcessor"/> 閫氳繃 <controller>鏉ユ浛浠?/span></p> <p><span style="color: red">org.apache.struts.action.RequestProcessor 鐨勮姹傚鐞嗐?/span></p> <table cellspacing="0" bordercolordark="#ffffff" cellpadding="2" width="400" align="center" bordercolorlight="#999999" border="1"> <tbody> <tr> <td class="code" bgcolor="#e6e6e6"> <pre>public class LoginAction extends Action { //鍒╃敤spring鏉ユ敞鍏ヨ繖涓璞°? private LoginDao dao ; public void setDao(LoginDao dao) { System.out.println("鎵ц娉ㄥ叆"); this.dao = dao; } public LoginDao getDao() { return dao; } public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { LoginForm loginForm = (LoginForm) form;// TODO Auto-generated method stub //榪欐牱涓鏀硅繖琛屼唬鐮佷技涔庢病鏈夊繀瑕佷簡銆? //WebApplicationContext ctx = this.getWebApplicationContext(); //LoginDao dao = (LoginDao) ctx.getBean("loginDao"); User u = new User(); u.setName(loginForm.getName()); u.setPwd(loginForm.getPwd()); //鐩存帴鐢╠ao鏉ヨ皟鐢╯pring浼?xì)灏啒q欎釜瀵硅薄瀹炰緥鍖栥? if(dao.checkLogin(u)){ return mapping.findForward("success"); }else{ return mapping.findForward("error"); } } } 榪欓噷鐨勩? LoginAction extends Action 璇存槑 struts娌℃湁鍜宻pring 鑰﹀悎銆? 鐪嬩竴涓? applicationContext.xml 涓殑閰嶇疆銆? 錛渂eans錛? 錛渂ean id="loginDao" class="com.cao.dao.LoginDao"/錛? 錛渂ean name="/login" class="com.cao.struts.action.LoginAction"錛? 錛減roperty name="dao"錛? 錛渞ef local="loginDao"/錛? 錛?property錛? 錛?bean錛? 錛?beans錛? </pre> </td> </tr> </tbody> </table> <br /> <p><span style="color: red">榪欓噷 name="/login" 涓巗truts 涓殑path鍖歸厤</span></p> <p><span style="color: red">class="com.cao.struts.action.LoginAction" 涓巗truts 涓殑type鍖歸厤</span></p> <p><span style="color: red">榪樿涓?LoginAction 鎻愪緵蹇呰鐨剆etXXX鏂規(guī)硶銆?鑾峰緱ApplicationCotext鍜屼緷璧栨敞鍏ョ殑宸ヤ綔閮藉湪DelegatingRequestProcessor涓畬鎴愩?/span></p> <p><strong>3錛屽叏鏉冨鎵橈細(xì)</strong></p> <p><span style="color: red">Action 鐨勫垱寤哄拰瀵硅薄鐨勪緷璧栨敞鍏ュ叏閮ㄧ敱IOC瀹瑰櫒鏉ュ畬鎴愩備嬌鐢⊿pring鐨凞elegatingAcionProxy鏉ュ府鍔╁疄鐜頒唬鐞嗙殑宸ヤ綔</span></p> <p><span style="color: red">org.springframework.web.struts.DelegatingActiongProxy緇ф壙浜巓rg.apache.struts.action.Action</span> .</p> <p>鍏ㄦ潈濮旀墭鐨勯厤緗柟寮忓悓 鏂瑰紡 2 綾諱技 錛坅pplcationContext.xml鏂囦歡鐨勯厤緗拰 Action綾葷殑瀹炵幇鏂瑰紡鐩稿悓錛夈?/p> <table cellspacing="0" bordercolordark="#ffffff" cellpadding="2" width="400" align="center" bordercolorlight="#999999" border="1"> <tbody> <tr> <td class="code" bgcolor="#e6e6e6"> <pre>錛渟truts-config錛? 錛渄ata-sources /錛? 錛渇orm-beans 錛? 錛渇orm-bean name="loginForm" </pre> <pre> type="com.cao.struts.form.LoginForm" /錛? 錛?form-beans錛? 錛済lobal-exceptions /錛? 錛済lobal-forwards /錛? 錛渁ction-mappings 錛? 錛?-- type鎸囧悜鐨勬槸spring 鐨勪唬鐞嗙被 --錛? 錛渁ction attribute="loginForm" input="login.jsp" name="loginForm" path="/login" scope="request" type="<span style="color: red">org.springframework.web.struts.DelegatingActionProxy</span>" 錛? 錛渇orward name="success" path="/ok.jsp" /錛? 錛渇orward name="error" path="/error.jsp" /錛? 錛?action錛? 錛?action-mappings錛? 錛渕essage-resources parameter="com.cao.struts.ApplicationResources" /錛? 錛減lug-in className=</pre> <pre> "org.springframework.web.struts.ContextLoaderPlugIn"錛? 錛渟et-property property="contextConfigLocation" </pre> <pre> value="/WEB-INF/applicationContext.xml"/錛? 錛?plug-in錛? 錛?struts-config錛? 涓嶅悓涔嬪 1錛?錛渁ction錛炰腑 type鎸囧悜鐨勬槸spring 鐨勪唬鐞嗙被 2錛?鍘繪帀struts-config.xml涓?錛渃ontroller 錛? </pre> </td> </tr> </tbody> </table> <p><br /> 涓夌鏁村拰鏂瑰紡涓垜浠紭鍏堥夌敤 鍏ㄦ潈濮旀墭鐨勬柟寮忋?/p> <p><strong>鐞嗙敱錛?/strong></p> <p>1錛岀涓縐嶄嬌寰楄繃澶氱殑鑰﹀悎浜哠pring鍜孉ction . </p> <p>2錛孯equestProcessor綾誨凡緇忚浠g悊 濡傛灉瑕佸啀瀹炵幇鑷繁鐨勫疄鐜版柟寮忥紙濡傦細(xì)緙栫爜澶勭悊錛夋曟湁鐐歸夯鐑?chǔ)銆?/p> <p>鎬葷粨涓涓嬶細(xì)</p> <p><strong>鏁村悎宸ヤ綔涓殑姝ラ錛?/strong></p> <p>1錛屼慨鏀箂truts-config.xml </p> <p>2錛?閰嶇疆a(chǎn)pplicationContext.xml </p> <p>3錛?涓篈ction娣誨姞get/set鏂規(guī)硶 鏉ヨ幏寰椾緷璧栨敞鍏ョ殑鍔熻兘銆?/p> <img src ="http://m.tkk7.com/forgood/aggbug/245062.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/forgood/" target="_blank">forgood</a> 2008-12-08 17:00 <a href="http://m.tkk7.com/forgood/archive/2008/12/08/245062.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://m.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://www045888.com" target="_blank">成年免费大片黄在线观看com</a>| <a href="http://huafagz.com" target="_blank">久久久久亚洲AV片无码</a>| <a href="http://www-456446.com" target="_blank">国产黄色片在线免费观看</a>| <a href="http://meixiudashi.com" target="_blank">免费三级毛片电影片</a>| <a href="http://chandou8.com" target="_blank">**一级一级毛片免费观看</a>| <a href="http://wenfaka.com" target="_blank">99re在线这里只有精品免费</a>| <a href="http://66cws.com" target="_blank">国产精品偷伦视频观看免费</a>| <a href="http://ygloka.com" target="_blank">免费无码H肉动漫在线观看麻豆</a>| <a href="http://dcqzr.com" target="_blank">国产精品免费视频观看拍拍</a>| <a href="http://1444000.com" target="_blank">国产视频精品免费视频</a>| <a href="http://shyangpuks.com" target="_blank">国产黄色片免费看</a>| <a href="http://400209.com" target="_blank">色播在线永久免费视频网站</a>| <a href="http://xxxxnii.com" target="_blank">永久免费A∨片在线观看</a>| <a href="http://sjkuaixun.com" target="_blank">国产精品免费无遮挡无码永久视频</a>| <a href="http://hjndgb.com" target="_blank">久久精品一区二区免费看</a>| <a href="http://445848.com" target="_blank">久久久久久AV无码免费网站 </a>| <a href="http://zisewang.com" target="_blank">综合久久久久久中文字幕亚洲国产国产综合一区首 </a>| <a href="http://se988.com" target="_blank">免费人成再在线观看网站</a>| <a href="http://snbbearing.com" target="_blank">麻豆va在线精品免费播放</a>| <a href="http://shzzhsy.com" target="_blank">午夜在线免费视频 </a>| <a href="http://nb46.com" target="_blank">亚洲日韩国产二区无码 </a>| <a href="http://sdshfengji.com" target="_blank">亚洲精品无码不卡在线播放HE</a>| <a href="http://yeshenghuowang.com" target="_blank">不卡一卡二卡三亚洲</a>| <a href="http://www-135888.com" target="_blank">亚洲自偷自偷图片</a>| <a href="http://aiqingdao999.com" target="_blank">久久精品国产精品亚洲艾草网</a>| <a href="http://shaonvfushi.com" target="_blank">无码乱人伦一区二区亚洲</a>| <a href="http://dazhe777.com" target="_blank">亚洲国产成人久久77</a>| <a href="http://ytsp88.com" target="_blank">亚洲人成网站免费播放</a>| <a href="http://044242.com" target="_blank">最新亚洲人成无码网www电影</a>| <a href="http://seosuanfa.com" target="_blank">特黄特色的大片观看免费视频</a>| <a href="http://010youhua.com" target="_blank">久久er国产精品免费观看8</a>| <a href="http://abab14.com" target="_blank">黄色免费在线网站</a>| <a href="http://doctor5470.com" target="_blank">最近中文字幕高清免费中文字幕mv</a>| <a href="http://27simnjingmiguan.com" target="_blank">84pao强力永久免费高清</a>| <a href="http://www52a.com" target="_blank">18禁成年无码免费网站无遮挡</a>| <a href="http://www91pao.com" target="_blank">国产片免费福利片永久</a>| <a href="http://726kxw.com" target="_blank">亚洲片一区二区三区</a>| <a href="http://199291.com" target="_blank">婷婷亚洲综合五月天小说</a>| <a href="http://zzxngk.com" target="_blank">亚洲日本一线产区和二线产区对比</a>| <a href="http://xawsfkaisuo.com" target="_blank">黄色毛片免费观看</a>| <a href="http://vvv75.com" target="_blank">久久狠狠躁免费观看</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>