打破神話

          Posted on 2005-10-08 12:13 BlueO2 閱讀(409) 評(píng)論(0)  編輯  收藏 所屬分類: MVC Framework
          我什么時(shí)候也起這么惡心的題目了,可能和某些同志混久了,也喜歡抓眼球了。言歸正傳,banq老爺子(這么叫挺可愛的),就是jdon創(chuàng)始的那個(gè)banq,其實(shí)我一直有些佩服有些BS的復(fù)雜情緒看待這樣一個(gè)人,banq技術(shù)上確實(shí)有幾下,起碼不是只會(huì)吵架的人,能研究些東西,但是,看他吵架和寫東西確實(shí)不是很舒服,總是感覺什么東西都是他banq的最好,他的jdonframework比spring先進(jìn)阿,HiveMind框架的思想他早就有啊之類的……翻翻帖子,看看gigix robbin怎么和banq結(jié)的梁子,有時(shí)候不禁噴飯。但是似乎所有大牛都有個(gè)特點(diǎn),什么東西都要評(píng)頭品足,我就納悶,世界上有這樣的人么?什么東西都研究的明明白白的。今天好不容易閑了,去jdon看看熱鬧,看有人吵架每(這心里夠bt),結(jié)果看到banq解答的struts問題的帖子,sigh,要是普通人我早就反駁了,可是因?yàn)槭莃anq,我又再次翻出來以前看的資料和源碼才敢指出:banq,u r wrong.而且是很基礎(chǔ)的很本質(zhì)的錯(cuò)誤。問題如下:
          感覺Struts標(biāo)簽太繁瑣了,想用 struts+velocity ,但是頁(yè)面如果沒有html:form等struts標(biāo)簽,頁(yè)面的form elements 是否能賦值到formbean中,formbean中的validate方法是否還有效。
          banq的理解:
          當(dāng)然不會(huì)有效。每個(gè)字段實(shí)際是通過:
          <html:text name="ACTIONFORM名稱" propert=""
          其中name很重要,指定了使用哪個(gè)ActionForm。
          俺給個(gè)解答,也請(qǐng)指出不足和理解上的偏頗:
          name:The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized.
          Any JavaBean can be used with the Struts JSP tags to populate a control. But to provide automatic validation of the input, Struts uses its own JavaBean subclass,called the ActionForm.
          The ActionForm solution
          The Struts solution to HTTP parameter handling is to transform the input fields into JavaBean properties. When a property on the ActionForm matches a parameter in the request, the framework automatically sets the property to the value of the parameter. A Struts developer can work with a trusty JavaBean and leave the HTTP rigmarole to the framework.To harvest request parameters, all the Struts developer needs to do is provide an ActionForm with JavaBean properties that match the names of the HTTP parameters. The rest is automatic.

          具體如何automatic解析,ActionForm如何被控制,有空再寫,畢竟struts研究的系列心得才進(jìn)行了很少篇blog,現(xiàn)在忙著webwork2 hibernate spring

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           

          posts - 29, comments - 3, trackbacks - 0, articles - 0

          Copyright © BlueO2

          主站蜘蛛池模板: 阿拉善盟| 弋阳县| 江达县| 鹿邑县| 武夷山市| 辰溪县| 新巴尔虎右旗| 浦城县| 永福县| 琼中| 徐汇区| 博白县| 德令哈市| 兰坪| 林芝县| 德昌县| 万源市| 雅江县| 北碚区| 察雅县| 汨罗市| 仙居县| 景谷| 蓬安县| 鄢陵县| 宝山区| 石嘴山市| 内乡县| 宁陕县| 蕲春县| 罗城| 赣州市| 普兰店市| 聂荣县| 新沂市| 建湖县| 西吉县| 文水县| 茌平县| 嘉禾县| 且末县|