日期:2014-05-16  浏览次数:20347 次

閫夋嫨JSF涓嶉€塖truts鐨勫崄澶х悊鐢?
鎴戠殑涓€涓鎴蜂笉鐭ラ亾璇ラ€夌敤Struts杩樻槸JSF銆傚氨鍍忎綘棰勬枡鐨勯偅鏍凤紝鎴戦€氬父浼氶棶锛氳繖2涓鏋朵箣闂存湁浠€涔堝尯鍒紵褰撶劧锛岄櫎浜嗘垜鐨勮繖涓鎴峰寰堝浜洪兘闈复杩欐牱鐨勯€夋嫨銆?

        鎬荤殑鏉ヨ锛屾垜寤鸿鍦ㄦ柊椤圭洰涓紭鍏堣€冭檻JSF銆傝櫧鐒跺父甯告湁涓€浜涘晢涓氫笂鐨勫洜绱犺揩浣挎垜浠负鐜版湁鐨勯」鐩€夋嫨浜哠truts锛岃€屼笖閭d簺瑙e喅鏂规杩樻湁寰呰€冮獙锛屼絾鏄紝璁╂垜浠潰瀵逛竴涓簨瀹烇細JSF姣擲truts濂藉浜嗐€?

        涓嬮潰鏄垜閫夋嫨JSF鑰屼笉閫塖truts鐨勫崄澶х悊鐢憋細

        1.Components(缁勪欢)

        2.Render Kits

        3.Renderers

        4.Value Binding Expressions锛堝€肩粦瀹氳〃杈惧紡锛?

        5.Event Model锛堜簨浠舵ā鍨嬶級

        6.Extensibility(鍙墿灞曟€?

        7.Managed Beans(Dependency Injection 渚濊禆娉ㄥ叆)

        8.POJO Action Methods

        9.JSF is the standard Java-based web app framework (JSF鏄痡ava web搴旂敤绋嬪簭鐨勬爣鍑嗘鏋?

        10.There's only one Struts(鍙湁涓€涓猄truts)

        10.There's only one Struts(鍙湁涓€涓猄truts)

        Struts鏄竴涓紑婧愪骇鍝侊紝鐒惰€孞SF鏄竴涓爣鍑嗐€傝繖涓粏鑺傚父甯歌鏂扮殑JSF瀛︿範鑰呭拷鐣ワ紝鍏跺疄杩欐槸鏄捐€屾槗瑙佺殑锛屽洜涓烘垜浠湁澶氫釜JSF鐨勫疄鐜般€傝櫧鐒禞SF杩樺緢涓嶆垚鐔燂紝浣嗘槸鎴戜滑宸茬粡鏈変簡2涓紭绉€鐨凧SF瀹炵幇鍙互閫夋嫨锛歋un鐨勫弬鑰冨疄鐜板拰Apache鐨凪yFaces銆傚彟涓€鏂归潰锛屾垜浠彧鏈変竴涓猄truts銆?

        9.JSF is the standard(JSF鏄爣鍑?

        JEE 5.0瑕佹彁渚涗竴涓狫SF鐨勫疄鐜帮紝杩欒〃鏄嶫SF涓嶄箙灏嗕細鏃犲涓嶅湪銆傝繖鍙兘涓庝綘鏃犲叧锛屼絾鏄拰宸ュ叿渚涘簲鍟嗗瘑鍒囩浉鍏炽€傜幇鍦ㄥぇ姒傛湁50涓猨ava web搴旂敤绋嬪簭妗嗘灦锛屽伐鍏蜂緵搴斿晢涓嶄細鎯呮効鍘绘敮鎸佷竴涓壒鍒殑妗嗘灦锛屼絾鏄粬浠細姣笉鐘硅鲍鐨勫幓鏀寔涓€涓爣鍑嗐€傝€屼笖涓嶆渚涘簲鍟嗭紝寮€婧愰」鐩篃浼氳繀閫熺殑鑱氶泦鍦↗SF鐨勫洓鍛紝浜夊厛鎭愬悗鐨勫幓瀹炵幇鐩稿悓鐨勫姛鑳姐€傛瘮濡傝锛岀洿鍒版垜浠幓瀹炵幇鏈川涓婂拰Shale鐨凾apestry宸笉澶氱殑瑙嗗浘鐨勬椂鍊欙紝鎴戞墠鐭ラ亾Facalets銆傦紙浠庨暱杩滄潵鐪嬶紝鎴戠浉淇¤繖绉嶅啑浣欐槸浠跺ソ浜嬶紝浼氱粰鎴戜滑甯︽潵濂藉锛?

        8.POJO Action Methods

        Struts鐨勮涓烘槸鍜孲truts鐨凙PI缁戝畾鍦ㄤ竴璧风殑锛屼絾鏄疛SF鐨勮涓烘柟娉曞彲浠ュ湪POJPO涓疄鐜般€傝繖鎰忓懗鐫€浣犱笉鐢ㄥ湪琛ㄥ崟鍜屾ā鍨嬪璞′箣闂村疄鐜颁竴涓浣欑殑琛屼负灞傘€傞『渚胯涓€涓嬶紝鍦↗SF閲岄潰娌℃湁琛屼负瀵硅薄锛岃涓哄湪妯″瀷瀵硅薄涓疄鐜般€備絾鏄篃璇锋敞鎰忎竴鐐癸細濡傛灉浣犳効鎰忎綘涔熷彲浠ョ敓鎴愪笌JSF鐙珛鐨勮涓哄璞°€傚湪Struts閲岄潰锛屼綘鏈塅orm. Bean鍜孉ction Bean銆侳orm. Bean鍖呭惈鏁版嵁鑰孉ction Bean鍖呭惈閫昏緫銆侽O鐙備細鎯冲幓鍚堝苟鍓?鑰咃紝鍦⊿truts浣犲姙涓嶅埌銆備絾鏄湪JSF涓紝浣犲彲浠ュ垎寮€鏁版嵁鍜岄€昏緫锛屼篃鍙互鍚堝苟鍒颁竴涓璞′腑锛屼竴鍒囩敱浣犲喅瀹氥€?

        7.Managed Beans(Dependency Injection 渚濊禆娉ㄥ叆)

        鍜孲pring涓€鏍凤紝JSF涔熶娇鐢ㄤ簡渚濊禆娉ㄥ叆锛圖J锛夛紙鎴栨帶鍒跺弽杞紙IoC锛夛級鍘诲疄渚嬪寲鍜屽垵濮嬪寲Bean銆係truts鐨勭‘涓轰綘鐢熸垚浜咶orm. Bean鍜孉ction Bean锛屼絾鏄疛SF鍙互涓轰綘鐢熸垚鍚勭鍚勬牱鐨凪anaged Bean銆?

        6.Extensibility(鍙墿灞曟€?

        杩欎釜寰堥噸瑕併€侸SF鏈?涓璞″疄鐜颁簡杩欎釜妗嗘灦鐨勫ぇ閮ㄥ垎鍔熻兘锛岃€屼笖浣犲彲浠ュ緢瀹规槗鐨勭敤浣犺嚜宸辩殑瀹炵幇浠f浛鍘熸湁瀹炵幇銆傛瘮濡備綘鎯冲姞涓€涓嚜瀹氫箟鍙傛暟鍦↗SF琛ㄨ揪寮忚瑷€閲岄潰锛屾垨鏄坊鍔犱竴涓嚜宸辩殑瑙嗗浘鎺у埗鍣ㄤ互渚夸簬鍖哄垎缁勪欢鍜孒TML銆備簨瀹炰笂Shale瀹炵幇浜嗕笂闈㈢殑鍔熻兘銆傚鏋滀綘杩樻病鏈夋弧瓒筹紝JSF鎻愪緵浜嗗嚑涓湴鏂逛綘鍙互杞绘澗鐨勬帶鍒禞SF鐨勭敓鍛藉懆鏈熴€係hale缁欎綘鐨勪細鏇村銆?

        5.Event Model锛堜簨浠舵ā鍨嬶級

        JSF鐨勪簨浠舵ā鍨嬩娇浣犲彲浠ュ鍊兼敼鍙橈紝鍔ㄤ綔锛孞SF鐢熷懡鍛ㄦ湡闃舵鍙樻崲绛変綔鍑哄弽搴斻€傚湪JSF1.1涓紝閭d簺浜嬩欢閮芥槸鍦ㄦ湇鍔″櫒绔鐞嗙殑锛岃繖鑲畾鏄竴涓己闄凤紝濂藉湪JSF2.0璁″垝鏀寔瀹㈡埛绔簨浠讹紝鎷洰浠ュ緟鍚с€?

        4.Value Binding Expressions锛堝€肩粦瀹氳〃杈惧紡锛?

        鍦⊿truts涓紝浣犺礋璐f妸鏁版嵁浠嶧orm浼犻€掑埌妯″瀷瀵硅薄銆備綘瀹炵幇鐨凙ction鐨別xecute鏂规硶鏄妸Form浣滀负涓€涓弬鏁般€傜劧鍚庝綘鍐嶆墜鍔ㄧ殑鎶婃暟鎹粠Form. Bean閲岄潰鍙栧嚭鏀惧埌妯″瀷瀵硅薄閲岄潰銆備綘瑕佷负搴旂敤閲岄潰鐨勬瘡涓狥orm鍋氳繖浜涗簨鎯咃紝鐒惰€屽湪JSF閲岄潰锛屼綘鍙渶鍍忚繖鏍凤細#{model.property} 灏卞浜嗭紝鍏朵粬鐨勪氦缁橨SF鏉ュ鐞嗐€?

        3.Renderers