锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲av区一区二区三,亚洲黄色免费电影,亚洲av最新在线网址http://m.tkk7.com/miracle/...zh-cnSun, 11 May 2025 02:18:52 GMTSun, 11 May 2025 02:18:52 GMT60Struts瀛︿範絎旇-1http://m.tkk7.com/miracle/archive/2005/11/23/miracle.htmlmiraclemiracleWed, 23 Nov 2005 15:10:00 GMThttp://m.tkk7.com/miracle/archive/2005/11/23/miracle.htmlhttp://m.tkk7.com/miracle/comments/21190.htmlhttp://m.tkk7.com/miracle/archive/2005/11/23/miracle.html#Feedback0http://m.tkk7.com/miracle/comments/commentRss/21190.htmlhttp://m.tkk7.com/miracle/services/trackbacks/21190.htmlServlet鐨勬紨鍙橈細鍦ㄥ父瑙勭殑 JSP錛孲ervlet錛孞avaBean涓夊眰緇撴瀯涓紝JSP瀹炵幇View鐨勫姛鑳斤紝Servlet瀹炵幇Controller鐨勫姛鑳斤紝JavaBean瀹炵幇Model鐨勫疄鐜般?BR>
鍦⊿truts涓紝灝嗗父瑙勬儏鍐典笅鐨凷ervlet鎷嗗垎涓嶢ctionServlet銆丗ormBean銆丄ctionBean涓変釜閮ㄥ垎銆侫ctionServlet閰嶅悎Struts-config.xml錛屼笓鑱屽畬鎴愰〉闈㈠鑸紝鑰屼笉鍐嶈礋璐e叿浣撶殑鏁版嵁鑾峰彇涓庣浉搴旈昏緫錛岃繖涓ら儴鍒嗗姛鑳界敱FormBean鍜孉ctionBean鏉ュ畬鎴愩?BR>
Struts鐨勬牳蹇冩槸Controller錛屽嵆ActionServlet錛岃孉ctionServlet鐨勬牳蹇冨氨鏄疭truts-config.xml錛孲truts-config.xml闆嗕腑浜嗘墍鏈夐〉闈㈢殑瀵艱埅瀹氫箟銆傚浜庡ぇ鍨嬬殑WEB欏圭洰錛岄氳繃姝ら厤緗枃浠跺嵆鍙繀閫熸妸鎻″叾鑴夌粶錛岃繖涓嶇鏄浜庡墠鏈熺殑寮鍙戯紝榪樻槸鍚庢湡鐨勭淮鎶ゆ垨鍗囩駭閮芥槸澶ф湁瑁ㄧ泭鐨勩傛帉鎻truts-config.xml鏄帉鎻truts鐨勫叧閿墍鍦ㄣ?BR>
<struts-config>

   <data-sources />

   <form-beans >
      <form-bean name="systemForm" type="com.gdglc.survey.form.SystemForm" />
      <form-bean name="FindMemberForm" type="org.apache.struts.validator.DynaValidatorForm">
         <form-property name="findName" type="java.lang.String"/>
      </form-bean>
   </form-beans>

   <global-exceptions />

   <global-forwards>
      <forward name="showMsg" path="/msg.jsp" />
   </global-forwards>

   <action-mappings>

      <action 
         path="/list" 
         type="com.gdglc.survey.action.ListAction">
         <forward name="list" path="/list.jsp"/>
      </action>

      <action
         attribute="systemForm"
         input="/admin/System_Base_List.jsp"
         name="systemForm"
         path="/systemBaseModify"
         type="com.gdglc.survey.action.SystemAction"
         scope="request"
         validate="false">
      </action>

   </action-mappings>

   <message-resources parameter="com.gdglc.application" />
  
   <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
      <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
   </plug-in>

</struts-config>

姣忎竴涓狥ormBean 閮藉繀欏葷戶鎵緼ctionForm綾伙紝FormBean鏄欏甸潰璇鋒眰鐨勫皝瑁呫傚嵆鎶奌TTP request 灝佽鍦ㄤ竴涓璞′腑錛?STRONG>闇瑕佽鏄庣殑涓鐐瑰氨鏄涓狧TTP request鍙互鍏辯敤涓涓狥ormBean錛屼究浜庣淮鎶ゅ拰閲嶇敤銆?BR>


public final class RegUserForm extends ActionForm{

   private String logname;
   private String password;
   private String email;

   public RegUserForm(){
      logname = null;
      password = null;
      email = null;
   }

   ......

   public void reset(ActionMapping mapping, HttpServletRequest request)
   {
      logname = null;
      password = null;
      email = null;
   }

   public ActionErrors validate(ActionMapping mapping,HttpServletRequest request) 
   {
      ActionErrors errors=new ActionErrors();
      if(this.password==null)
         errors.add(ActionErrors.GLOBAL_ERROR,new ActionError("password is null!!"));
      ......
      return errors;
    }
}

FormBean鐨勪駭鐢熸槸涓轟簡鎻愪緵鏁版嵁緇橝ctionBean錛屽湪ActionBean涓彲浠ュ彇寰桭ormBean涓皝瑁呯殑鏁版嵁錛岀粡鐩稿簲鐨勯昏緫澶勭悊鍚庯紝璋冪敤涓氬姟鏂規硶瀹屾垚鐩稿簲涓氬姟瑕佹眰銆?BR>
public final class RegUserAction extends Action
{
   public ActionForward execute(ActionMapping mapping,
                                                  ActionForm form, 
                                                  HttpServletRequest request,
                                                  HttpServletResponse response)

   {
      ......
      if(true)
         return mapping.findForwad("list");
      else {
         ActionErrors errors=new ActionErrors();
         errors.add(ActionErrors.GLOBAL_ERROR,new ActionError("...."));
         this.saveErrors(request,errors);
         return new ActionForward(mapping.getInput());
      }
   }
}

Struts浼樼己鐐?BR>浼樼偣錛?/STRONG>

Struts璺烼omcat銆乀urbine絳夎澶欰pache欏圭洰涓鏍鳳紝鏄紑婧愯蔣浠訛紝榪欐槸瀹冪殑涓澶т紭鐐廣備嬌寮鍙戣呰兘鏇存繁鍏ョ殑浜嗚В鍏跺唴閮ㄥ疄鐜版満鍒躲?BR>
闄ゆ涔嬪錛?STRONG>Struts鐨勪紭鐐逛富瑕侀泦涓綋鐜板湪涓や釜鏂歸潰錛歍aglib鍜岄〉闈㈠鑸?/STRONG>Taglib鏄疭truts鐨勬爣璁板簱錛岀伒媧誨姩鐢紝鑳藉ぇ澶ф彁楂樺紑鍙戞晥鐜囥傚彟澶栵紝灝辯洰鍓嶅浗鍐呯殑JSP寮鍙戣呰岃█錛岄櫎浜嗕嬌鐢↗SP鑷甫鐨勫父鐢ㄦ爣璁板錛屽緢灝戝紑鍙戣嚜宸辯殑鏍囪錛屾垨璁窼truts鏄竴涓緢濂界殑璧風偣銆?BR>
鍏充簬欏甸潰瀵艱埅錛屾垜璁や負閭e皢鏄粖鍚庣殑涓涓彂灞曟柟鍚戯紝浜嬪疄涓婏紝榪欐牱鍋氾紝浣跨郴緇熺殑鑴夌粶鏇村姞娓呮櫚銆傞氳繃涓涓厤緗枃浠訛紝鍗沖彲鎶婃彙鏁翠釜緋葷粺鍚勯儴鍒嗕箣闂寸殑鑱旂郴錛岃繖瀵逛簬鍚庢湡鐨勭淮鎶ゆ湁鐫鑾ぇ鐨勫ソ澶勩傚挨鍏舵槸褰撳彟涓鎵瑰紑鍙戣呮帴鎵嬭繖涓」鐩椂錛岃繖縐嶄紭鍔夸綋鐜板緱鏇村姞鏄庢樉銆?BR>
緙虹偣錛?/B>

Taglib鏄疭truts鐨勪竴澶т紭鍔匡紝浣嗗浜庡垵瀛﹁呰岃█錛屽嵈闇瑕佷竴涓寔緇涔犵殑榪囩▼錛岀敋鑷寵繕浼氭墦涔變綘緗戦〉緙栧啓鐨勪範鎯紝浣嗘槸錛屽綋浣犱範鎯簡瀹冩椂錛屼綘浼氳寰楀畠鐪熺殑寰堟銆?BR>
Struts灝哅VC鐨凜ontroller涓鍒嗕負涓夛紝鍦ㄨ幏寰楃粨鏋勬洿鍔犳竻鏅扮殑鍚屾椂錛屼篃澧炲姞浜嗙郴緇熺殑澶嶆潅搴︺?BR>
Struts浠庝駭鐢熷埌鐜板湪榪樹笉鍒板崐騫達紝浣嗗凡閫愭瓚婃潵瓚婂榪愮敤浜庡晢涓氳蔣浠躲傝櫧鐒跺畠鐜板湪榪樻湁涓嶅皯緙虹偣錛屼絾瀹冩槸涓縐嶉潪甯鎬紭縐鐨凧2EE MVC瀹炵幇鏂瑰紡錛屽鏋滀綘鐨勭郴緇熷噯澶囬噰鐢↗2EE MVC鏋舵瀯錛岄偅涔堬紝涓嶅Θ鑰冭檻涓涓婼truts銆?BR>
Struts瀹炴柦緇忛獙錛?BR>
1)銆佸熀浜嶴truts鏋舵瀯鐨勯」鐩紑鍙戯紝棣栧厛闇瑕佹湁涓涓緢濂界殑鏁翠綋瑙勫垝錛屾暣涓郴緇熶腑鍖呮嫭鍝嚑涓ā鍧楋紝姣忎釜妯″潡鍚勯渶瑕佸灝慒ormBean鍜孉ctionBean絳夛紝鑰屼笖鏈濂芥湁涓撲漢璐熻矗Struts-config.xml鐨勭鐞嗐傚紑鍙戝熀浜嶴truts鐨勯」鐩殑闅劇偣鍦ㄤ簬閰嶇疆綆$悊錛屽挨鍏舵槸瀵筍truts-config.xml鐨勭鐞嗐?BR>
2)銆佸鏋滀綘鐨勯」鐩潪甯哥揣錛屽茍涓旈」鐩粍涓張娌℃湁瀵屾湁緇忛獙鐨凷truts寮鍙戜漢鍛橈紝寤鴻涓嶈鍐掔劧閲囩敤Struts銆係truts鐨勬帉鎻¢渶瑕佷竴涓繃紼嬶紝瀵逛簬涓涓啛緇冪殑JSP紼嬪簭鍛橈紝鑷澶ф闇瑕佸崐涓湀宸﹀彸鐨勬椂闂淬傚鏋滅粨鍚坱itls錛屽垯闇瑕佹洿闀跨殑鏃墮棿銆?BR>
3)銆佸鏋滀綘鍦ㄧ綉欏典腑澶ч噺榪愮敤taglib錛岄偅涔堜綘鐨勭編宸ュ皢鍋氬嚭閮ㄥ垎鐗虹壊銆傚綋浣犵粨鍚圱iles錛屽姛鑳藉寮虹殑鍚屾椂錛岃繖縐嶇壓鐗插挨涓烘槑鏄俱傚綋鐒訛紝浣犲鍔熻兘鍜岀編瑙傜殑鍙栬垗鐢變綘鑷繁鍐沖畾銆?BR>
4)銆乀aglib鏄竴涓ソ涓滆タ錛屼絾鐏墊椿榪愮敤瀹冨嵈闇瑕佷竴涓繃紼嬶紝濡傛灉浣犱笉鎯沖湪Taglib涓婅姳澶鐨勬椂闂達紝閭d箞鍙渶鐞嗚В涓嶧ORM鏈夊叧鐨勫嚑涓爣璁幫紝鍏跺畠鐨勬爣璁板氨鏀劇潃鍚э紝浠ュ悗鍐嶇湅錛屽厛鍘葷爺絀禔ctionServlet鍜孲truts-config.xml錛屼綘浼氳寰楀緢鏈夋垚灝辨劅銆?BR>
5)銆丼truts鏄惁鍙傚悎浜庡ぇ鍨嬮」鐩憿錛烴o錛丼truts閫傚悎浜庡悇縐嶅ぇ灝忕殑欏圭洰錛屽綋鐒訛紝瀵逛簬澶у瀷欏圭洰錛屽畠鎵浣撶幇鍑烘潵鐨勪紭鍔挎洿鍔犳槑鏄俱?

http://www.chinaitlab.com/www/news/article_show.asp?id=33092

miracle 2005-11-23 23:10 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 亚洲人成网77777亚洲色| 国产一级大片免费看| 亚洲熟妇无码八AV在线播放| 看一级毛片免费观看视频| 最好免费观看韩国+日本| 亚洲日韩亚洲另类激情文学| 野花高清在线观看免费完整版中文 | 久久精品国产亚洲AV果冻传媒| 久久av免费天堂小草播放| 一本色道久久综合亚洲精品高清| 国产精品成人免费观看| 久久亚洲中文字幕精品一区 | 人人公开免费超级碰碰碰视频| 免费h黄肉动漫在线观看| 美女视频黄.免费网址| 最新国产AV无码专区亚洲| 久久久受www免费人成| 国产∨亚洲V天堂无码久久久| 日韩免费高清播放器| 色婷婷六月亚洲婷婷丁香| 国产91免费视频| 亚洲日本中文字幕天天更新| 凹凸精品视频分类国产品免费| 成人免费网站视频www| 亚洲AV日韩AV永久无码免下载 | 亚洲国产另类久久久精品小说| 暖暖日本免费中文字幕| 亚洲1区1区3区4区产品乱码芒果| 在线观看免费国产视频| 国产乱子伦精品免费视频| 久久亚洲精精品中文字幕| 成熟女人特级毛片www免费| 成在线人直播免费视频| 亚洲视频在线免费观看| 在线免费观看a级片| 久青草视频在线观看免费| 亚洲精品影院久久久久久| 日本成人免费在线| 国产一精品一AV一免费| 日本亚洲精品色婷婷在线影院| 亚洲精品国产高清不卡在线|