锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲人成电影在线天堂,亚洲妇女水蜜桃av网网站,jlzzjlzz亚洲乱熟在线播放http://www.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://www.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://www.tkk7.com/forgood/archive/2008/12/08/245062.html</guid><wfw:comment>http://www.tkk7.com/forgood/comments/245062.html</wfw:comment><comments>http://www.tkk7.com/forgood/archive/2008/12/08/245062.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/forgood/comments/commentRss/245062.html</wfw:commentRss><trackback:ping>http://www.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://www.tkk7.com/forgood/aggbug/245062.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/forgood/" target="_blank">forgood</a> 2008-12-08 17:00 <a href="http://www.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://www.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://wua72.com" target="_blank">日韩免费a级毛片无码a∨</a>| <a href="http://www-13696.com" target="_blank">黄色免费在线网站</a>| <a href="http://nmcytsi.com" target="_blank">在线观看免费为成年视频</a>| <a href="http://watchmini.com" target="_blank">亚洲一级毛片视频</a>| <a href="http://470577.com" target="_blank">中文毛片无遮挡高潮免费</a>| <a href="http://ynyinglie.com" target="_blank">99久久精品国产亚洲</a>| <a href="http://bbby6.com" target="_blank">中文字幕免费在线观看</a>| <a href="http://rdccc.com" target="_blank">亚洲国产午夜精品理论片</a>| <a href="http://avqvod.com" target="_blank">18勿入网站免费永久</a>| <a href="http://h588888.com" target="_blank">亚洲人成网男女大片在线播放</a>| <a href="http://www-777730.com" target="_blank">欧美好看的免费电影在线观看</a>| <a href="http://9v9av.com" target="_blank">亚洲国产欧洲综合997久久</a>| <a href="http://500308k.com" target="_blank">四虎影视免费在线</a>| <a href="http://jpsp8.com" target="_blank">一区二区三区在线免费观看视频</a>| <a href="http://51caox.com" target="_blank">亚洲一区二区三区自拍公司</a>| <a href="http://zzmm88.com" target="_blank">久久国产精品免费看</a>| <a href="http://chandou8.com" target="_blank">亚洲精品第一国产综合精品</a>| <a href="http://ynrygc.com" target="_blank">久久精品无码一区二区三区免费</a>| <a href="http://52xbjs.com" target="_blank">99亚洲男女激情在线观看</a>| <a href="http://guhey.com" target="_blank">亚洲性日韩精品国产一区二区</a>| <a href="http://www44xixi.com" target="_blank">免费人成激情视频在线观看冫 </a>| <a href="http://class3g.com" target="_blank">免费AA片少妇人AA片直播</a>| <a href="http://bjjs365.com" target="_blank">亚洲偷自精品三十六区</a>| <a href="http://600c20.com" target="_blank">免费在线观看理论片</a>| <a href="http://xuexilo.com" target="_blank">91在线视频免费观看</a>| <a href="http://102sds.com" target="_blank">亚洲国产高清视频在线观看</a>| <a href="http://520xiang.com" target="_blank">日本无卡码免费一区二区三区</a>| <a href="http://zisewang.com" target="_blank">jizz18免费视频</a>| <a href="http://557265.com" target="_blank">亚洲欧洲日韩在线电影</a>| <a href="http://www04ggg.com" target="_blank">国产视频精品免费</a>| <a href="http://langya2255.com" target="_blank">国产福利免费视频</a>| <a href="http://fphs666.com" target="_blank">亚洲同性男gay网站在线观看</a>| <a href="http://gjwlgzs.com" target="_blank">国产一级特黄高清免费大片</a>| <a href="http://mhysf.com" target="_blank">永久免费av无码入口国语片</a>| <a href="http://3333seav.com" target="_blank">国产.亚洲.欧洲在线</a>| <a href="http://bjqhkf.com" target="_blank">精品亚洲一区二区三区在线观看 </a>| <a href="http://783944.com" target="_blank">一二三四在线观看免费高清中文在线观看 </a>| <a href="http://289qq.com" target="_blank">亚洲性无码AV中文字幕</a>| <a href="http://mlhcd.com" target="_blank">国外亚洲成AV人片在线观看</a>| <a href="http://yiuzz.com" target="_blank">91手机看片国产永久免费</a>| <a href="http://www2626cf.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>