锘??xml version="1.0" encoding="utf-8" standalone="yes"?> 鏄庡ぉ鎵撶畻緇欓偅浜涚粍浠舵墍鏈塸ublic鐨勬柟娉曞啓涓婃祴璇曠敤渚?-铏界劧鑺辨椂闂寸粰鍒漢鐨勪唬鐮佸啓嫻嬭瘯鏄瀬涓烘棤鑱婄殑琛屼負錛屼絾鏄幇鍦ㄦ垜涔熻浜嗭紝涓嶈兘鍐嶈繖鏍鋒彁蹇冨悐鑳嗗緱鍐欎唬鐮佸拰鎵嬪伐嫻嬭瘯浜嗭紝瀹佸彲鑺變笂涓涓笂鍗堢敋鑷蟲洿澶氱殑鏃墮棿鏉ュ啓鐢ㄤ緥鎼緩鐜銆俁od Johnson璇村緱瀵規瀬浜?鐗涗粩寮忕湡鏄紪紼嬪姝伙細婊″ぉ椋炵殑宸ュ巶妯″紡銆佸崟渚嬨侀潤鎬佸彉閲忥紝浠涔堟敞閲婇兘娌℃湁鐨勭洃鍚帴鍙?---鏈閲嶈鐨勬槸錛屾病鏈夋祴璇曠敤渚?-涔冭繕綆楃▼搴忓憳鍚楋紵鐭ラ亾鑰佸瓙鑺變簡澶氬皯鏃墮棿鏉ユ嫓璇諱慨鏀歸噸鏋剆tep in,step over鎮ㄧ殑"澶т綔"錛焗oly shit.銆銆springframework.org璁哄潧閲屾湁鏉¤瘎璁猴紝緲昏瘧榪囨潵澶ф灝辨槸璇達紝srcp紼嬪簭璇村埌搴?灝辨槸鐢ㄥ嚑涓猨ar鍜岄厤緗枃浠舵妸浣犵殑swing搴旂敤緇勭粐璧鋒潵鐨勬湁鐫澶嶆潅鐨勮璁$粨鏋勭殑xx"錛堝ソ鍚ф垜涓嶇悊瑙d貢緲昏瘧錛夛紝璇磋搗swing錛屼負浜嗗吋欏懼悇涓柟闈㈢殑鍥犵礌(涓昏鏄痗oncurrency)錛宻wing鐨勫紑鍙戣呬滑涓嶅緱涓嶈swing鐨勪嬌鐢ㄨ呬滑鍦ㄤ竴涓總鍥炴洸鎶樼殑鐜涓紪鍐欎粬浠殑搴旂敤銆傝繖灝卞ソ鍍忓湪涓搴у簽澶х殑閲戝瓧濉斿唴閮ㄨ瀵熷畠鐨勫緩絳戠粨鏋勪竴鏍鳳紝浣犱細鍙戝嚭闃甸樀鎯婂徆錛涗篃浼氱粔璧風湁澶磋糠鎯戜笉瑙?-寮濮嬬殑鏃跺欏悗鑰呮槸榪滆繙澶氳繃鍓嶈呯殑銆傚洖榪囨潵鐪嬬湅鐜板湪濡傜伀濡傝嵓鐨剋eb寮鍙戯紝鎯蟲兂錛寃eb寮鍙戞槸涓嶆槸鍦ㄨ蛋10鍑?0騫村墠鐨勮佽礬錛屼粈涔堟墠鏄▼搴忕殑鐪熻皼鍛紵
鎺ヤ笅鏉ュ噯澶囧涔犱竴鐐規暟鎹寲鎺樻柟闈㈢殑鐭ヨ瘑錛屽叿浣撶偣鏄涔夊垎鏋愩傚洜涓哄叕鍙稿湪鏁版嵁閲囬泦榪欐柟闈㈣繕鐩稿綋鍘熷鐨剆pider+鎵嬪伐鏀跺壊錛屽拰st璋堝埌榪欎釜鏃朵篃鎻愬埌涓彲閫夌殑鏂規錛屽ぉ鐭ラ亾閭d釜鐪嬩笂鍘諱笉鑹皯騫翠竴鏍風殑瀹朵紮鑴戣閲屽埌搴曡浜嗗灝戜笢瑗褲傚ソ浜嗭紝榪欏懆鎵撶畻鎷栨嫋鎷夋媺鍦版妸鑷姩鏇存柊updater鍐欏畬錛岄『渚跨湅鐪嬫湁娌℃満浼氬紕鎴愪竴涓氱敤鐨剈pdater銆傜涓鏈熺殑涓氬姟閫昏緫涓嶅鏉傦紝鎵浠ヤ篃鏆傛椂娌℃垜浠涔堜簨錛屾濂藉彲浠ヤ竴鍙剼绔欏湪闂ㄥ緇嗗績鐬呯瀰錛屽叾浠栫瓑璇勪及緇撴灉鍑烘潵浜嗗啀璇淬傚垰鎵嶆敹淇℃椂鍊欑湅鍒版湁灝?4鍙風殑offer letter錛屽瘑瀵嗛夯楹葷殑鑻辨枃鎼炲緱foxmail閮芥妸瀹冧涪鍒板瀮鍦劇閲屽幓浜嗐?br/>
鍘熼瑕佹眰鐢╦ava錛岀敤python鍙槸涓轟簡鏂逛究銆傜敤鍥炴函娉曞揩錛屼絾鏄繕鏄潥鎸佺敤閬嶅巻媯灄鏉ュ啓錛岃繖涔熸槸闈㈣瘯鏃舵病鎯沖畬鐨勬濊礬錛屽懙鍛碉紝鎴戝氨鏄嚜鎵鵑夯鐑︾殑紜煶澶存ф牸銆?/p>
鏈鍏堟兂鍒扮敤鏃犲悜榪為氬浘榪涜娣卞害浼樺厛鎼滅儲錛屼絾鏄病鏈夎冭檻鍒扮粨鏉熸潯浠躲傚浜嶯涓緟鎺掑垪鐨勬暟瀛楋紝姣忎釜鑺傜偣閮芥湁N-1涓嚭鍙e拰鍏ュ彛錛岃岀敤鏍戠姸緇撴瀯姣忎釜鑺傜偣鍙湁涓涓埗鑺傜偣錛屽瓨鍦ㄩ掑綊榪斿洖鐨勬潯浠躲備絾鏄繖涓柟娉曠殑瀹炵敤鎬у彧闄愬埗鍦ㄥ綋鎺掑垪鏁板緢灝戯紙N < 8錛夋椂銆傚綋N>8鏃剁畻娉曟秷鑰楃殑鏃墮棿鏄庢樉澧炲姞(涓鍏?*7*6*5*4*3*2*1=40320縐嶇粍鍚?錛屽綋N>1000鏃?褰撶劧錛岃繖縐嶆儏鍐墊槸涓嶆暍鎯沖儚鐨?灝變細杈懼埌python鐨勯掑綊鏋侀檺銆傛墍浠ョ湡姝e鏋滆騫茬偣浠涔堢殑璇?褰撶劧錛岄珮涓敓閮界煡閬撳叏鎺掑垪鎷?2寮犳墤鍏嬬墝鍑烘潵鎺掍竴涓嬬粨鏋滈泦灝辨槸涓ぉ鏂囨暟瀛?錛岃繖鏄劇劧涓嶆槸涓ソ綆楁硶銆?/p>
.
Issue 1: Poor integration tests, as everything is being tested in isolation
I鈥檝e had good experience with mock-based testing. However, it鈥檚 obvious that mocks will only test classes in isolation. I use both unit tests and integration tests (sometimes called system or acceptance tests) together. The need for integration tests is not an issue for mock-based techniques and is not a good reason to use less mocks. It鈥檚 just a different aspect of testing. A more common issue in my experience is that people in the agile community who are new to testing often don鈥檛 understand these different aspects of testing and seem to believe that mock-based unit testing and integration testing are mutually exclusive options. The lack of common terminology in the community only worsens the problem. For some people, a 鈥渦nit鈥?is a class or small group of tightly coupled classes. For others, it鈥檚 a large portion of the software product. Most agile developers seem to call every test they write a unit test. It鈥檚 become so confusing for some teams that I鈥檝e seen terminology like 鈥渋ntegration unit tests鈥?being used to describe testing strategies.
But, back to the topic. Poor integration testing is simply the result of lack of integration tests. Mocks do not cause a lack of integration tests. A team makes that choice, probably based on a weak understanding of the tradeoffs between isolation (unit) and integration (system) testing.
Issue 2: Mocks add complexity to the software design.
鈥淚鈥檝e seen numerous occasions where the introduction of mocks has added a large amount of complexity to an otherwise simple design. This complexity leads to higher implementation costs, a higher cognitive load on the developers working on the system, and higher maintenance costs (as there鈥檚 more code to maintain). 鈥?/p>
The author appears to focused on the increased use of interfaces when using mock-based testing and expresses the opinion that interfaces should only be used where we鈥檇 want to be able to replace one implementation with another. First, there are other reasons to use interfaces. In general, interfaces are useful for managing dependencies between software components or subsystems. This can be beneficial even if the implementations do not change (see The Dependency Inversion Principle).
A modular software design will generally make it easier to use mock-based testing without altering the design specifically for the mocks. However, there are times when the software must be modified to support testing. Fortunately, the changes needed to support testing often, if done well, support the modularity goal.
In my experience, extra interfaces don鈥檛 add a significant maintenance overhead. Most effort is spent implementing the interface. The time writing the interface itself (or extracting it using an IDE鈥檚 refactoring tools) is negligible.
My Conclusions
In almost every case, I see the 鈥渟implicity鈥?gained by not using mocks overshadowed by complex test setups to initialize large groups of dependent objects. The dark side of integration testing is that it鈥檚 often very slow for large numbers of tests. Some teams are using continuous integration tools like Cruise Control to run their 鈥渦nit tests鈥?(usually they are actually integration tests). This delays the feedback about broken builds but is often necessary because the tests run so slow. I realize there other reasons for using CC, but this is a common one from what I鈥檝e seen and heard.
I鈥檝e worked on teams where we had thousands of tests that ran in less than 15-20 seconds total on a developer workstation. This was a direct result of heavy use of mock-based testing. We also had a slower suite of integration tests that required 4-5 minutes to run. We didn鈥檛 need a continuous integration server because we were able to integrate and run our unit tests before every commit to the source control system. The team integrated 10-20 times/day and broken builds were practically nonexistent over the several years I worked with them. In the very rare cases when the build did break, it was typically fixed in a matter of minutes.
The other benefit of the isolation testing enabled by mocks is the ability to pinpoint problems much more quickly. It鈥檚 a form of the divide and conquer problem solving strategy, only the divide part is already done. The conquering is relatively easy compared to tracking down the cause of test failures when many classes are being exercised in a test.
My experience was that our mock based unit tests caught about 98% of the code problems before the code was ever committed to source control. The integration tests caught about another 1% beyond that (almost always because of a flaw in the mock-based testing) and manual testing caught the other 1%.
2006-05-22 澧炲姞 5.1 鍒濆鍖?velocity
2006-05-21 澧炲姞 4.1 - 4.2 HttpSession鎿嶄綔
鏇存柊note:
1.HttpServletRequest鐨?a href="file:///D:/jakarta-tomcat-4.1.30/servlet%20api/javax/servlet/ServletRequest.html#getParameterNames()">getParameterNames()聽鏂規硶榪斿洖鐨凟numeration鐩稿浜庨〉闈㈠弬鏁扮殑鐗╃悊欏哄簭鍒氬ソ鏄浉鍙嶇殑,鎵浠ュ疄鐜癅ToList鏍囩鏃跺欓渶瑕佸厛鐢ㄤ竴涓猄tack鏉ュ鎵鏈夊弬鏁拌繘琛屽弽杞?涓嶇煡tomcat鍦ㄨ繖涓猘pi鏂規硶涓婃槸鎬庝箞瀹炵幇鐨?涓轟粈涔堝氨鍊掕繃鏉ャ俢璇█鍑芥暟鍙互鏍規嵁涓嶅悓鐨刢all綾誨瀷鏉ユ寚瀹氫笉鍚岀殑鍘嬫爤鐨勯『搴忥紝鑾潪榪欎釜鎯緥涔熻鐢ㄥ埌servlet閲岄潰鏉ヤ簡錛屾尯鏈夋剰鎬濈殑涓滆タ錛岀湅鏉ラ渶瑕佺暀鎰忎竴涓嬨?br />
闂鍜岃В鍐蟲柟寮?
1.鍏充簬@ToSession鏍囩.濡傛灉鏄櫥闄嗙殑璇?閭d箞灝辨湁涓垽鏂潯浠跺喅瀹氭煇涓猯ogin token鏄惁搴旇琚姞鍒皊ession涓?榪欐椂鍊欏彲浠ュ湪@ToSession鏍囪鐨刧etter鏂規硶涓姞鍏ラ昏緫鍒ゆ柇,鏉ュ喅瀹氳繑鍥炰竴涓猼oken瀹炰綋鎴栬卬ull(榪欐牱鍋氭湁鐐瑰彜鎬?.).
2.璺緞鐨勯棶棰?姣斿涓涓?a href="http://host/logic/bbs/admin/ListUsers.wff">http://host/logic/bbs/admin/ListUsers.wff 鎽哥増鐨勭浉鍏寵祫婧愮洰褰?姣斿,鍥劇墖,css,js絳?灝卞繀欏誨瓨鍦╳ebproject/bbs/admin鍝嶅簲鐨勭洰褰曚笅,鏈夌偣鍍弒truts鐨勫妯″潡.
寮濮?
Ruby on Rails鏈変釜璁捐鎬濇兂鏄敤緙栫爜瑙勫畾浠f浛綣佺悙鐨勯厤緗枃浠躲俲vm騫沖彴宸茬粡鏈変竴浜涚被浼紃or鐨勫疄鐜幫紝姣斿
grails(http://docs.codehaus.org/display/GRAILS/2006/03/29/Groovy+on+Rails+(Grails)+0.1+Released)
铏界劧鐢變簬java鑷韓鐨勫眬闄愶紝瀹冨緢闅懼仛鍑哄儚ruby鎴栬単roovy閭f牱鍔ㄦ佽璦閭f牱闅忓績鎵嬈茬殑鍔ㄤ綔錛屼絾鏄埄鐢ㄥ畠鐨勮繍琛屾椂鍙嶅皠銆佸姩鎬佷唬鐞嗙瓑鐗規ф潵灝藉彲鑳藉疄鐜扳滅敤緙栫爜瑙勫畾浠f浛綣佺悙鐨勯厤緗枃浠垛濊繖涓鎬濇兂銆?br />涓嬮潰杞叆姝i銆?/p>
ServletAPI瀵笻TTP鍗忚榪涜浜嗗皝瑁?閫氳繃閰嶇疆Web.xml鏉ユ妸涓嶅悓鐨勮姹傝漿鍙戠粰涓嶅悓鐨剆ervlet鏉ュ鐞嗐俉eb妗嗘灦鍒欑敤涓涓狝ctionServlet錛屾牴鎹嚜宸辯殑瀵笰ction鐨勫畾涔夋潵杞彂璇鋒眰銆?br />鎶涘紑閭d簺綣佺悙鐨勯厤緗枃浠訛紝璁炬兂涓涓嬭繖鏍蜂竴縐嶆柟娉?
1.Web鍔ㄤ綔鐨勫鐞嗗拰鍝嶅簲
鍋囪榪欐牱涓涓狿OST璇鋒眰:
聽 <form action="logic/group/NewTopic.wff" method="post">
Web鍔ㄤ綔瀹炵幇Bean:
聽聽 org.qqsns.web.logic.group.NewTopic聽聽
娉ㄦ剰鍚庨潰鐨刲ogic/group/NewTopic鍜宭ogic.group.NewTopic, 鍔ㄤ綔綾誨拰Web鍔ㄤ綔鏄氳繃璇鋒眰璺緞鍜屽寘鍚嶇浉浜掑叧鑱斻?br />榪欐牱錛屽Web鍔ㄤ綔鐨勫搷搴斿氨渚濊禆浜庣紪璇戞湡鐨勪唬鐮佺殑緇勭粐緇撴瀯鑰屼笉鏄墽琛屾湡鐨勯厤緗枃浠躲傝繖鏍風殑濂藉鏄伩鍏嶄簡緇存姢綣佺悙鐨勯厤緗枃浠?鐗瑰埆鏄湪娌℃湁IDE鏀寔鐨勬儏鍐典笅銆?/p>
org.qqsns.web.logic.group.NewTopic綾繪槸涓涓疄鐜皀et.wff.servlet.WebAction鎺ュ彛鐨凱OJO錛屼笅闈㈡槸NewTopic涓璭xecute鐨勬柟娉曠墖孌?聽聽
聽
聽//Only method must be implemented for interface net.wff.servlet.WebAction
聽public String execute(WebParam param,聽VelocityView view)
聽throws ServletException, IOException{
聽聽...
聽聽//return "redirect /success.html";聽 //璇鋒眰閲嶅畾鍚?br />聽聽return "/success.jsp";聽聽聽聽聽聽聽聽聽聽聽聽聽 //璇鋒眰杞彂
}
execute鏂規硶鐨勮繑鍥炲兼墜鍔ㄦ寚瀹氫簡涓涓漿鍙戞垨閲嶅畾鍚戠殑璺緞銆?/p>
2.杈撳叆楠岃瘉
鏅氱殑Web妗嗘灦閮藉甫鏁版嵁杈撳叆楠岃瘉鍔熻兘,涓鑸鏉傜▼搴﹀拰鍔熻兘寮哄ぇ涓庡惁鎴愭姣斻?br />榪欓噷綆鍗曞湴瑕佹眰浠巗etter鏂規硶閲屾姏鍑轟竴涓寘鍚獙璇佷俊鎭殑寮傚父錛屼互姝ゆ潵瀹炵幇杈撳叆寮傚父澶勭悊銆?br />聽聽聽聽聽聽
鏅歴etter鏂規硶
public void setName(String name){聽
聽聽this.name = name;
}
娣誨姞杈撳叆楠岃瘉鍚庣殑setter鏂規硶
public void setName(String name) throws InputException{聽聽聽
聽if(name.length()<3)
聽聽聽 throw new InputException("Topic name must has a length greater than 3");聽
聽聽this.name = name;
}
鍦╓aterFallServlet濡備綍涓鐞嗛獙璇佷俊鎭?
聽聽聽 WebAction wa =
聽聽聽 (WebAction)Class.forName(classPath).newInstance();
聽聽聽聽聽聽聽聽聽 //procces forwarding
聽聽聽聽聽聽聽聽聽 try {
聽聽聽聽ActionHelper.setProperties(request,wa);
聽聽聽} catch (InputException e) {
聽聽聽聽//return to input view
聽聽聽聽//header:referer
聽聽聽聽String rtn = request.getHeader("referer");
聽聽聽聽//clear old errors
聽聽聽聽if(rtn.indexOf("?")!=1){
聽聽聽聽聽rtn = rtn.substring(0,rtn.indexOf("?"));
聽聽聽聽}
聽聽聽聽rtn=rtn+"?error="+URLEncoder.encode(e.getMessage(),"UTF-8");
聽聽聽聽response.sendRedirect(rtn);
聽聽聽聽return;
聽聽聽}
榪欐牱楠岃瘉淇℃伅閫氳繃璇鋒眰鍙傛暟浼犲洖鍒拌緭鍏ラ〉闈?
3.鏁版嵁緇戝畾
鍋囪鏈夎繖鏍風殑html杈撳叆:
聽聽聽 <input type="text" name="name"/>
聽聽聽 <input type="text" name="number"/>
聽聽聽 <input type="text" name="price"/>
聽聽聽
聽涓嬮潰鏄疦ewTopic涓璭xecute鐨勬柟娉曞叏閮?聽聽
聽
聽public String execute(WebParam param, VelocityView view)
聽throws ServletException, IOException{
聽聽System.out.println(getName());
聽聽System.out.println(getNumber());
聽聽System.out.println(getPrice());
聽聽System.out.println(getLength());
聽聽return "/success.html";
}
聽聽聽
鑷姩浠巖equest娉ㄥ叆parameter,榪欎篃鏄疭truts DynamicActionForm鐨勫ソ澶勪箣涓銆?br />涓嶈繃榪欓噷瀹炵幇鏇寸被浼煎浜嗙被鍨嬭漿鎹㈢殑<jsp:setProperty name="bean" property="*"/>
鍥犱負Name鐨勭被鍨嬫槸String,Number鐨勭被鍨嬫槸Integer,Price鐨勭被鍨嬫槸float,length鐨勭被鍨嬫槸double.鑷充簬鍏朵粬澶嶆潅鐨勭被鍨?涔熻jsf鐨勮漿鎹㈠櫒鏄釜鏇村ソ鐨勪富鎰忋?br />榪欐牱灝卞垵姝ヨВ鍐充簡鏁版嵁鐨勮緭鍏ョ粦瀹氬拰楠岃瘉銆備綑涓嬬殑灝辨槸涓氬姟閫昏緫鐨勯棶棰樸?/p>
4.濡備綍鎿嶄綔Session涓殑淇℃伅
聽
聽鑾峰彇session涓殑淇℃伅:
聽 @FromSession(
聽聽聽聽 sessionKey=User.key
聽聽聽聽 )
聽public void setCurrentUser(String currentUser) {
聽聽this.currentUser = currentUser;
聽}
聽淇℃伅淇濆瓨鍒皊ession涓?聽
聽 @ToSession(
聽聽聽聽聽 sessionKey = User.key聽聽
聽聽聽 )
聽public String getName() {
聽聽if(login())return name;
聽聽else return null;
聽}
聽榪?涓柟娉曞畾涔夊湪WebAction鐨勫疄鐜扮被涓?br />聽妗嗘灦鍦╡xecute()涔嬪墠鎵ц@FromSession鍔ㄤ綔錛屽湪execute()涔嬪悗鎵ц@ToSession鍔ㄤ綔銆?br />聽榪欓噷浣跨敤浜哸nnotation,鎵浠ヨ姹傚繀欏繪槸jdk5.0浠ヤ笂鐗堟湰.
聽
聽5.1 Velocity
聽 waterfall鍚姩鏃跺欒嚜鍔ㄥ湪WEB-INF鐩綍涓嬪鎵懼茍鍒濆鍖朧elocity.properties鏂囦歡
聽鎿嶄綔:
聽public String execute(WebParam param,聽VelocityView view)
聽throws ServletException, IOException{
聽聽view.addElement("msg","Hello");
聽 view.go("index.vm");
聽聽return null;
}
ServletAPI瀵笻TTP鍗忚榪涜浜嗗皝瑁?閫氳繃閰嶇疆Web.xml鏉ユ妸涓嶅悓鐨勮姹傝漿鍙戠粰涓嶅悓鐨剆ervlet鏉ュ鐞嗐俉eb妗嗘灦鍒欑敤涓涓狝ctionServlet錛屾牴鎹嚜宸辯殑瀵笰ction鐨勫畾涔夋潵杞彂璇鋒眰銆?br />鎶涘紑閭d簺綣佺悙鐨勯厤緗枃浠訛紝璁炬兂涓涓嬭繖鏍蜂竴縐嶆柟娉?
1.Web鍔ㄤ綔鐨勫鐞嗗拰鍝嶅簲
鍋囪榪欐牱涓涓狿OST璇鋒眰:
Web鍔ㄤ綔瀹炵幇Bean:
娉ㄦ剰鍚庨潰鐨?em>logic/group/NewTopic鍜?em>logic.group.NewTopic, 鍔ㄤ綔綾誨拰Web鍔ㄤ綔鏄氳繃璇鋒眰璺緞鍜屽寘鍚嶇浉浜掑叧鑱斻?br />榪欐牱錛屽Web鍔ㄤ綔鐨勫搷搴斿氨渚濊禆浜?strong>緙栬瘧鏈熺殑浠g爜鐨勭粍緇囩粨鏋?/strong>鑰屼笉鏄?strong>鎵ц鏈熺殑閰嶇疆鏂囦歡銆傝繖鏍風殑濂藉鏄伩鍏嶄簡緇存姢綣佺悙鐨勯厤緗枃浠?鐗瑰埆鏄湪娌℃湁IDE鏀寔鐨勬儏鍐典笅銆?/p>
org.qqsns.web.logic.group.NewTopic綾繪槸涓涓疄鐜皀et.wff.servlet.WebAction鎺ュ彛鐨凱OJO錛屼笅闈㈡槸NewTopic涓璭xecute鐨勬柟娉曠墖孌?聽聽聽
聽execute鏂規硶鐨勮繑鍥炲兼墜鍔ㄦ寚瀹氫簡涓涓漿鍙戞垨閲嶅畾鍚戠殑璺緞銆?/p>
2.杈撳叆楠岃瘉
鏅氱殑Web妗嗘灦閮藉甫鏁版嵁杈撳叆楠岃瘉鍔熻兘,涓鑸鏉傜▼搴﹀拰鍔熻兘寮哄ぇ涓庡惁鎴愭姣斻?br />榪欓噷綆鍗曞湴瑕佹眰浠巗etter鏂規硶閲屾姏鍑轟竴涓寘鍚獙璇佷俊鎭殑寮傚父錛屼互姝ゆ潵瀹炵幇杈撳叆寮傚父澶勭悊銆?br />聽聽聽聽聽聽
鏅歴etter鏂規硶
娣誨姞杈撳叆楠岃瘉鍚庣殑setter鏂規硶
WaterFallServlet鏄浣曞鐞嗛獙璇佷俊鎭殑:
榪欐牱楠岃瘉淇℃伅閫氳繃璇鋒眰鍙傛暟浼犲洖鍒拌緭鍏ラ〉闈?
3.鏁版嵁緇戝畾
鍋囪鏈夎繖鏍風殑html杈撳叆:聽
聽涓嬮潰鏄疦ewTopic涓璭xecute鐨勬柟娉曞叏閮?聽聽聽
鑷姩浠巖equest娉ㄥ叆parameter,榪欎篃璁告槸寰堝浜哄枩嬈truts DynamicActionForm鐨勫師鍥犱箣涓銆?br />涓嶈繃榪欓噷瀹炵幇鏇寸被浼煎浜嗙被鍨嬭漿鎹㈢殑<jsp:setProperty name="bean" property="*"/>
鍥犱負Name鐨勭被鍨嬫槸String,Number鐨勭被鍨嬫槸Integer,Price鐨勭被鍨嬫槸float,length鐨勭被鍨嬫槸double.鑷充簬鍏朵粬澶嶆潅鐨勭被鍨?涔熻jsf鐨勮漿鎹㈠櫒鏄釜鏇村ソ鐨勪富鎰忋?br />榪欐牱灝卞垵姝ヨВ鍐充簡鏁版嵁鐨勮緭鍏ョ粦瀹氬拰楠岃瘉銆備綑涓嬬殑灝辨槸涓氬姟閫昏緫鐨勯棶棰樸俉aterfallWebFramework婧愪唬鐮?
http://m.tkk7.com/Files/zqc/WaterfallWebFramework.rar聽(鍙湁涓涓厤緗枃浠?鍏朵腑鍙湁1琛岄厤緗俊鎭?)
浠ヤ笂灝辨槸妗嗘灦鐨勪富瑕佸姛鑳姐?strong>鐢ㄧ紪鐮佽瀹氫唬鏇塊厤緗枃浠?/strong>錛屼篃璁歌繖浼氭槸涓縐嶆洿鍔犻珮鏁堢巼鐨勫紑鍙戞柟寮忋?br />