JAVA涂鴉
          關于JAVA的點點滴滴
          posts - 50,  comments - 689,  trackbacks - 0

          很不好意思,開始下載鏈接放錯了,現在是新的。

          這是前面那個struts1.x+spring1.x+hibernater3.1的升級版本。

          spring2.0與1.x區別不大,可以平滑的過度,我也就是把spring1.28換成了spring2.0.3,算是升級到spring 2.0了。

          struts2.0基本就是webwork2.2,與以前的struts1.x可以說沒任何關系了。

          因為是第一次用struts2.0,也是第一次用webwork,所以有很多不完善,不規范的地方,還望大家來拍磚。

          下次在將這次使用struts2.0的心得寫篇文章。

          因為是對前一次寫的struts+spring+hibernate的改進,所以一些新的朋友還不知道數據庫以及架構是什么樣子的。
          建議可以先看看這里:
          struts+spring+hibernate的web應用<一> 架構搭建

          lib包需要以下這些包


          示例代碼下載


          相關信息:

          項目架構以及數據庫信息
          struts+spring+hibernate的web應用<一> 架構搭建

          更多信息  

          posted on 2007-04-19 16:05 千山鳥飛絕 閱讀(11571) 評論(20)  編輯  收藏

          FeedBack:
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2007-04-19 16:18 | 交口稱贊
          多謝,最近也在看struts2  回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2007-04-19 17:02 | 交口稱贊
          用的sqlserver?

            回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2007-04-19 17:02 | 交口稱贊
          建議下次用UTF-8  回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2007-04-19 17:09 | javajman
          多謝,我最近也在學struts2  回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2007-04-19 17:22 | javajman
          struts2?????


          好象是struts1.X吧?!~~~  回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2007-04-19 17:34 | 千山鳥飛絕
          @javajman

          不好意思,開始鏈接放錯了,希望下載錯誤的朋友重新下載
            回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2007-04-19 21:56 | yluck
          下載后學習收益非淺。
          希望有多一些的示例。
          順便請教下,
          有二個表格,a與b.
          這二者是一對多的關系,并在Hibernate中進行了映射配置。
          現想依據a表查出所有數據,包括與a對應的b表中的數據。
          方法最終得要的結果類型為List型.

          因為List類型中,有包含a,b二表的數據。
          請教,這個List類型,如何在JSP頁面中顯示。
          (只顯示a中的數據沒有問題,就是不會一同顯示b中的數據)  回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2007-04-20 09:50 | 海藍
          @千山鳥飛絕

          哈哈,我讀了你舊版的文章,也嘗試象你這樣用struts2改寫舊版的代碼,已經基本上實現了。原本打算整理完畢后跟你交流交流的;現在你已經弄出來了,我就偷懶了~~~  回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2007-04-20 11:25 | 海藍
          樓主的源碼還是有些問題吧?

          我在struts_products.xml中看到:

          <action name="list" class="productAction" method="list">
          <result>list.jsp</result>
          </action>

          但是源碼中并沒有productAction.java ......  回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2007-04-20 11:28 | 海藍
          @千山鳥飛絕

          Sorry,原來productAction這個bean是在applicationContext.xml中定義的  回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2007-04-20 15:49 | 海藍
          @千山鳥飛絕

          重新測試了代碼,在我這里需要做以下修改才能運行:
          1.將index.jsp從/products目錄移到/目錄里
          2.將struts_products.xml中
          <package name="products" extends="struts-default" namespace="/products">
          修改為
          <package name="products" extends="struts-default">
          3.將struts_products.xml中各個action的result
          <result>xxxx.jsp</result>
          修改為
          <result>/products/xxxx.jsp</result>

          此外我使用MySQL,所以把dataSource改為
          <bean id ="dataSource" class ="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
          <property name="driverClassName" value="com.mysql.jdbc.Driver" />
          <property name="url" value="jdbc:mysql://localhost:3306/game" />
          <property name="username" value="root" />
          <property name="password" value="mypass"/>
          </bean>
          但新增一個游戲后保存,輸入的中文均顯示為?。將相應字段的Collation改為gbk_chinese_ci、gbk_bin都不行。不知是哪里不正確?  回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2007-04-20 16:05 | 千山鳥飛絕
          @海藍
          我使用的數據庫是SQLServer2000,mysql沒有測試過。

          你可以用eclipse調試一下,看看product在insert之前保存的值是不是亂碼,這樣就可以判斷是否是傳值的原因,還是數據庫的原因。  回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2007-05-03 11:31 | Sullivan
          請問你的JSP文件在哪里呢?我下載下來都沒有發現有的。謝謝  回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2007-05-04 08:56 | 千山鳥飛絕
          @Sullivan
          在products文件夾里面  回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2007-08-21 19:05 | winie
          學習中`````````我 也想整個`````````
          謝謝樓主的程序`收益`````````````呵呵````  回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2007-10-26 10:45 | 中華信鴿
          下載了。  回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2007-11-13 09:59 | ju
          ok  回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2008-01-17 16:02 | pooslife
          @交口稱贊
          同意..GB2312讓我很困擾啊.  回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2008-01-17 16:05 | pooslife
          @海藍
          你的mysql用的什么編碼?
          這個需要編碼對應上才行的
          例如:
          jdbc:mysql://localhost:3306/game?useUnicode=true&characterEncoding=GB2312  回復  更多評論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應用 示例代碼下載
          2009-08-30 16:32 | 自言自語
          謝謝!  回復  更多評論
            

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


          網站導航:
           
          正在閱讀:



          <2007年4月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(35)

          隨筆檔案

          文章分類

          文章檔案

          好友的blog

          我的其他blog

          老婆的Blog

          搜索

          •  

          積分與排名

          • 積分 - 775408
          • 排名 - 56

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 平顺县| 澜沧| 什邡市| 牙克石市| 海丰县| 乐平市| 昔阳县| 富蕴县| 理塘县| 中方县| 连山| 海安县| 临泉县| 平罗县| 汉寿县| 临颍县| 青海省| 崇义县| 志丹县| 青河县| 彝良县| 千阳县| 武鸣县| 齐河县| 茌平县| 克山县| 屯门区| 衡东县| 松阳县| 固原市| 华蓥市| 荥阳市| 米脂县| 上虞市| 贡嘎县| 尉氏县| 遵义市| 伽师县| 昌黎县| 揭西县| 新和县|