posts - 48, comments - 13, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          下載apache-maven-2.0.9-bin軟件包,在path里加上了bin路徑,運行mvn -version總是出現java.lang.NoClassDefFoundError: org/codehaus/classworlds/Launcher 的錯誤,重新下載了maven-2.0.5-bin.zip將path路徑改為\maven-2.0.5-bin\maven-2.0.5\bin,并增加了一個M2_HOME路徑\maven-2.0.5-bin\maven-2.0.5,再次運行成功!在\maven-2.0.5-bin\maven-2.0.5\core\boot 路徑下classworlds-1.1.jar包里就有要找的文件org.codehaus.classworlds.Launcher!

          posted @ 2009-02-17 14:33 董銳 閱讀(6148) | 評論 (0)編輯 收藏

          在tapestry4中使用了session值,要記得在pageBeginRender中第一次進入清空,其后不需清空。

          posted @ 2009-02-13 17:10 董銳 閱讀(143) | 評論 (0)編輯 收藏

          什么是Tapestry?
          歡迎來到Tapestry世界!
          本文是一篇幫助人們使用Tapestry5來創建應用程序的指導文章。不論你是否會使用Tapestry4(或Tapestry3)或者你對Tapestry完全陌生,都不影響你閱讀此篇指南,事實上你對一般的互聯網程序開發知道的越少,Tapestry則對你是越好的選擇,因為你可以少學很多!
            當然你還是需要知道以下一些知識:HTML、XML,基本的Java語言特性和一些新一點的東西如Java Annotations.
          如果你是用servlets、JSP或Struts來開發互聯網應用程序的,或許你已對很多麻煩的事情習以為常了。或許你并沒有意識到你所處的可怕處境。這些環境沒有安全保障;Struts和Servlet API不知道你程序的架構是如何的,不知道各個不同的塊是如何連接起來的。任何一個URL地址都可以是一個Action并且每個Action都可以前進到任何一個顯示頁面(通常是JSP頁面),這些顯示頁面會生成返回到客戶端瀏覽器的HTML頁面。作為一個開發者,你必須要做出一系列永無止盡的小而重要的決定(并且要與你的開發團隊進行協商),如actions、頁面、屬性等的命名規范、變量存放在HttpSession中還是存放在HttpServletRequest中等等,這些都是麻煩的事情。
          傳統方式將很多你不想要的東西推向你:多線程編程。還記得以前學習面向對象編程?一個對象可以定義為一組數據以及對這些數據進行操作的集合?當你開始互聯網編程后你就必須忘記這個課程,因為互聯網編程是多線程的。一個應用服務器可以處理來自單個用戶的幾十、上百個請求,每一個用戶都有自己的線程,而且每一個用戶都共享相同的對象。 突然,你發現不能在一個對象(一個servlet或一個struts Action)中存儲數據,因為不論你為一個用戶存放什么數據,它都會立馬被某個其他用戶的數據覆蓋。
          更糟的是,你的每個對象都有一個方法:doGet()或doPost()。
          期間你每天工作的大部分內容是決定如何將你已經存儲在java對象中的數據給打包然后把這些數據擠壓進一個URL地址的請求參數里,然后你得再寫些代碼把這些數據給轉換回來。同時要記得修改一大堆存儲在servlet容器或Struts框架中的XML文件,讓它們知道這些決定。

          posted @ 2009-02-05 15:03 董銳 閱讀(220) | 評論 (0)編輯 收藏

          22 <component id="aPersonSelect" type="PropertySelection">
          23 <binding name="model" value="ognl:personSelectModel"/>
          24 <binding name="value" value="ognl:components.table.tableRow.aPerson"/>
          25 </component>

          ognl:OgnlException:source is null for getProperty(null, "aPerson")

          錯誤描述:這是一個component中一個表A,還有一個表B,最初是表A顯示,表B隱藏,顯示沒有問題,然后點擊component中一個按鈕,隱藏表A,顯示表B,就出現這樣的錯誤。

          判斷1:以為表A的數據源沒有在Session保存,導致點擊按鈕重新裝載頁面時數據源為空,所以出現此錯誤,就將數據源改為session狀態,還是有此錯誤
          判斷2:表A和表B是共用同一數據源,只是Column值有變化,修改為只用一個表,點擊按鈕時setColumn賦不同值,測試發現點擊后表格內容沒有變化,賦Column值失敗
          判斷3:還是表A和表B,此次表A和表B使用不同數據源變量,點擊按鈕時表A數據表中內容選取部分賦給表B數據源,點擊按鈕,依然出現上述錯誤。

          錯誤未解決:
          待續。。。
          -------------------------------------------
          判斷4:<td jwcid="aPersonColumnValue@Block"><span jwcid="aPersonSelect" /></td>
          在.html文件中屏蔽此句,沒有錯誤。
          ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
          終于找到錯誤原因了:
          原來表A和表B的列名相同,都用了aPerson,所以當顯示表B時,為表A所用的<td jwcid="aPersonColumnValue@Block"><span jwcid="aPersonSelect" /></td>也為表B所用了,而表B的aPerson用的是:aPerson:aPerson.name,所以每次獲取aPerson值都為空,修改表B的column為aPerson1:aPerson.name即成功!!
          找了這么久,原來是這個錯誤,汗!!!!

          posted @ 2009-02-01 10:57 董銳 閱讀(222) | 評論 (0)編輯 收藏

          如果propertySelection中是復雜對象,一定記得要重載public boolean equals(Object obj)方法才可以順利選中初始值哦!

          posted @ 2009-01-22 18:07 董銳 閱讀(175) | 評論 (0)編輯 收藏

          http://tapestry.apache.org/tapestry5/guide/persist.html

          Most instance variables in Tapestry are automatically cleared at the end of each request.
          通常每次請求結束,Tapestry會將實例變量清空。

          This is important, as it pertains to how Tapestry pages are pooled and shared, over time, by many users.
          這很重要,因為Tapestry的頁面是在緩沖池中被許多用戶共享的。

          However, you often want to store some persistent data on a page, and have access to it in later requests.
          然而,你通常希望在頁面存儲一些持久數據,這樣后面的請求可以得到這些數據。

          This is accomplished with the Persist annotation.

          This annotation is applied to private instance fields.

            @Persist
          private int value;

          Annotated fields will store their state between requests. Generally, speaking, this means that the value is stored into the session (but other approaches are possible).

          Whenever you make a change to a persistent field, its value is stored.

          On later requests, the value for such persistent fields is reloaded from storage.



          Persistence Strategies

          The value for each field is the strategy used to store the field between requests.

          session strategy

          The session strategy stores field changes into the session; the session is created as necessary.

          A suitably long session attribute name is used; it incorporates the name of the page, the nested component id, and the name of the field.

          Session strategy is the default strategy used unless otherwise overridden.

          Session策略是默認策略。

          flash strategy

          The flash strategy stores information in the session as well, just for not very long. Values are stored into the session, but then deleted from the session as they are first used to restore a page's state.

          The flash is typically used to store temporary messages that should only be displayed to the user once.

          client strategy

          The field is persisted onto the client; you will see an additional query parameter in each URL (or an extra hidden field in each form).


          Client  持久花費的代價要高些,它會在渲染頁面的每個鏈接后面加上數百字節的額外信息。

          Client persistence is somewhat expensive. It can bloat the size of the rendered pages by adding hundreds of characters to each link. There is extra processing on each request to de-serialize the values encoded into the query parameter.

          Client persistence does not scale very well; as more information is stored into the query parameter, its length can become problematic. In many cases, web browsers, firewalls or other servers may silently truncate the URL which will break the application. 有時URL地址太長會被截掉。

          Use client persistence with care, and store a minimal amount of data. Try to store the identity (that is, primary key) of an object, rather than the object itself.

          posted @ 2009-01-21 16:49 董銳 閱讀(221) | 評論 (0)編輯 收藏

          Iterative Development and the unified process
          People are more important than any process.
          Good people with a good process will outperform good people with no process every time.
                  --Grady Booch

          Case Study: The NextGen PosSystem
          Few things are harder to put up with than a good example.
                  --Mark Twain

          Inception
          The best is the enemy of the good!
                  --Voltaire

          Understanding requirements
          Ours is a world where people don't know what they want and are willing to go through hell to get it.
                  --Don Marquis

          Use-Case Model: Writing requirements in Context
          The indispensable first step to getting the things you want out of life:decide what you want.
                  --Ben Stein

          Identifying other requirements
          When ideas fail, words come in very handy.
                  --Johann Wolfgang von Goethe

          From inception to elaboration
          The hard and stiff breaks. The supple prevails.
                  --Tao Te Ching

          Use-Case Model: Drawing System Sequence Diagrams
          In theory, there is no difference between theory and practice. But, in practice, there is.
                  --Jan L.A. van de Snepscheut

          Domain Model: Visualizing Concepts
          It's all very well in practice, but it will never work in theory.
                  --anonymous management maxim

          Domain Model: Adding Attributes
          Any sufficiently advanced bug is indistinguishable from a feature.
                  --Rich Kulawiec

          Use-Case Model: Adding Detail With Operation Contracts
          Fast, Cheap, Good: Choose any two.
              --anonymous

          From Requirements to Design in this iteration
          Hardware,n.: The parts of a computer system that can be kicked.
              --anonymous

          Iteration Diagram Notation
           Cats are smarter than dogs. You can't get eight cats to pull a sled through snow.
              --Jeff Valdez

          GRASP:Designing Objects with responsibilities
          The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents.
              --Nathaniel Borenstein

          Design Model: Use-Case Realizations With GRASP Patterns
          To invent, you need a good imagination and a pile of junk.
              --Thomas Edison

          Design Model: Determining Visibility
          A mathematician is a device for turning coffee into theorems.
              --Paul Erdos

          Design Model: Creating Design Class Diagrams
          To iterate is human, to recurse, divine.
              --anonymous

          Implementation Model: Mapping Designs To Code
          Beware of bugs in the above code; I have only proved it correct, not tried it.
              --Donald Knuth

          GRASP:More patterns for assigning responsibilities
          Luck is the residue of design.
              --Branch Rickey

          Designing Use-Case Realizations with GoF Design Patterns
          Anything you can do, I can do meta.
                  --Daniel Dennett

          Relating Use Cases
          Why do programmers get Halloween and Christmas mixed up? Because OCT(31)=DEC(25)

          Modeling Generalization
          Crude classifications and false generalizations are the curse of the organized life.
              --A generalization by H.G.Wells

          Refining the Domain Model
          PRESENT, n. That part of eternity dividing the domain of disappointment from the realm of hope.
              --Ambrose Bierce

          Adding new SSDs and Contracts
          Virtue is insufficient temptation.
              --George Bernard Shaw

          Modeling Behavior in statechart diagrams
          Usability is like oxygen--you never notice it until it is missing.
            --anonymous

          Designing the logical architecture with patterns
          0x2B | ~0x2B
                  --Hamlet

          Organizing the design and implementation model packages
          If you were plowing a field, which would you rather use? Two strong oxen or 1024 chickens?
              --Seymour Cray

          Introduction To Architectual Analysis and the SAD
          Error, no keyboard ~ press F1 to continue.
              --early PC BIOS message

          Designing more use-case realizations with objects and patterns
          On two occasions I have been asked (by memebers of Parliament), "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able rightly to apprehand the kind of confusion of ideas that could provoke such a question.
               --Charles Babbage

          Designing  a persistence framework with patterns
          Time is a good teacher, but unfortunately it kills all its pupils.
              --Hector Berlioz

          On drawing and tools
          Bubbles don't crash.
            --Bertrand Meyer

          Introduction to iterative planning and project isssues
          Prediction is very difficult, especially if it's about the future.
              --anonymous

          Comments on Iterative Development and the UP
          You should use iterative development only on projects that you want to succeed.
              --Martin Fowler

          posted @ 2009-01-19 03:59 董銳 閱讀(212) | 評論 (0)編輯 收藏

              Analysis: do the right thing;
              Design: do the thing right!

          posted @ 2009-01-19 03:10 董銳 閱讀(114) | 評論 (0)編輯 收藏

          今天中午急著打個新包發布,但是怎么打都打不成功,同樣的build.xml,在自機器上運行也沒有問題,怎么就打不成功呢,雖然知道不成功是因為class沒有編譯全,也就是說有一個java文件有問題,導致編譯不全,但我在eclipse下把個各包是看了又看,沒發現哪里有紅叉叉啊,eclipse下沒有紅叉叉,但又編譯有問題,我真是想不明白,越是急越是想不明白。
          最后終于通過查看到底少了哪些class來逐個查看,終于找到那個問題文件了,打開那個文件,很明顯的有個紅條條顯示問題在哪里,但是這個文件在eclipse目錄下卻沒有紅叉叉,本來文件里有紅條條,對應目錄應該有紅叉叉,但是這個不知為什么沒有,真是奇怪,算不算eclipse的BUG呢?

          posted @ 2009-01-12 14:23 董銳 閱讀(110) | 評論 (0)編輯 收藏

          其他同事瀏覽器顯示都正常,就只有一個同事顯示為空白,瀏覽器下方狀態欄里多了一個小黃色三角!(感嘆)符號,點開來是IE管理加載項的界面。
          這個同事禁用了很多加載項,后來一個一個試,將Shockwave Flash Object設為啟用后,頁面就可以正常顯示了。
          這個頁面唯一不同與其他的頁面的地方是它加載了dojo.js文件,我估計是dojo.js文件里有用到Shockwave Flash Object里的東西。
          看來,有用到dojo.js的朋友需要注意了,要啟用Shockwave Flash Object加載才能正常顯示哦!! 

          posted @ 2009-01-09 13:15 董銳 閱讀(1484) | 評論 (3)編輯 收藏

          僅列出標題
          共5頁: 上一頁 1 2 3 4 5 下一頁 
          主站蜘蛛池模板: 玛多县| 扎鲁特旗| 松溪县| 石阡县| 冀州市| 玉山县| 新丰县| 西华县| 鹤庆县| 普安县| 孝感市| 盐城市| 依兰县| 朝阳区| 文山县| 梓潼县| 张北县| 射洪县| 安平县| 汝阳县| 罗甸县| 靖宇县| 浮梁县| 从江县| 海淀区| 阿拉善右旗| 积石山| 盘山县| 江阴市| 名山县| 苍溪县| 岳普湖县| 泰宁县| 乳山市| 台山市| 郯城县| 集安市| 锡林浩特市| 嵊州市| 卓资县| 定兴县|