打破神話

          Posted on 2005-10-08 12:13 BlueO2 閱讀(411) 評論(0)  編輯  收藏 所屬分類: MVC Framework
          我什么時候也起這么惡心的題目了,可能和某些同志混久了,也喜歡抓眼球了。言歸正傳,banq老爺子(這么叫挺可愛的),就是jdon創(chuàng)始的那個banq,其實(shí)我一直有些佩服有些BS的復(fù)雜情緒看待這樣一個人,banq技術(shù)上確實(shí)有幾下,起碼不是只會吵架的人,能研究些東西,但是,看他吵架和寫東西確實(shí)不是很舒服,總是感覺什么東西都是他banq的最好,他的jdonframework比spring先進(jìn)阿,HiveMind框架的思想他早就有啊之類的……翻翻帖子,看看gigix robbin怎么和banq結(jié)的梁子,有時候不禁噴飯。但是似乎所有大牛都有個特點(diǎn),什么東西都要評頭品足,我就納悶,世界上有這樣的人么?什么東西都研究的明明白白的。今天好不容易閑了,去jdon看看熱鬧,看有人吵架每(這心里夠bt),結(jié)果看到banq解答的struts問題的帖子,sigh,要是普通人我早就反駁了,可是因?yàn)槭莃anq,我又再次翻出來以前看的資料和源碼才敢指出:banq,u r wrong.而且是很基礎(chǔ)的很本質(zhì)的錯誤。問題如下:
          感覺Struts標(biāo)簽太繁瑣了,想用 struts+velocity ,但是頁面如果沒有html:form等struts標(biāo)簽,頁面的form elements 是否能賦值到formbean中,formbean中的validate方法是否還有效。
          banq的理解:
          當(dāng)然不會有效。每個字段實(shí)際是通過:
          <html:text name="ACTIONFORM名稱" propert=""
          其中name很重要,指定了使用哪個ActionForm。
          俺給個解答,也請指出不足和理解上的偏頗:
          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

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


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

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

          Copyright © BlueO2

          主站蜘蛛池模板: 定襄县| 达拉特旗| 黄山市| 崇信县| 成安县| 平利县| 石首市| 曲阜市| 永安市| 浑源县| 公安县| 清远市| 寿阳县| 溧水县| 澜沧| 巴楚县| 清流县| 正定县| 达拉特旗| 台中县| 虹口区| 汉阴县| 曲松县| 遵义县| 军事| 紫阳县| 嵩明县| 高安市| 泰州市| 南开区| 邻水| 本溪市| 嘉鱼县| 桐乡市| 昭平县| 南投市| 台州市| 光山县| 洪雅县| 始兴县| 鄂托克前旗|