JAVA涂鴉
          關(guān)于JAVA的點(diǎn)點(diǎn)滴滴
          posts - 50,  comments - 689,  trackbacks - 0

          很不好意思,開始下載鏈接放錯(cuò)了,現(xiàn)在是新的。

          這是前面那個(gè)struts1.x+spring1.x+hibernater3.1的升級(jí)版本。

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

          struts2.0基本就是webwork2.2,與以前的struts1.x可以說(shuō)沒任何關(guān)系了。

          因?yàn)槭堑谝淮斡胹truts2.0,也是第一次用webwork,所以有很多不完善,不規(guī)范的地方,還望大家來(lái)拍磚。

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

          因?yàn)槭菍?duì)前一次寫的struts+spring+hibernate的改進(jìn),所以一些新的朋友還不知道數(shù)據(jù)庫(kù)以及架構(gòu)是什么樣子的。
          建議可以先看看這里:
          struts+spring+hibernate的web應(yīng)用<一> 架構(gòu)搭建

          lib包需要以下這些包


          示例代碼下載


          相關(guān)信息:

          項(xiàng)目架構(gòu)以及數(shù)據(jù)庫(kù)信息
          struts+spring+hibernate的web應(yīng)用<一> 架構(gòu)搭建

          更多信息  

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

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

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


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

          不好意思,開始鏈接放錯(cuò)了,希望下載錯(cuò)誤的朋友重新下載
            回復(fù)  更多評(píng)論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應(yīng)用 示例代碼下載
          2007-04-19 21:56 | yluck
          下載后學(xué)習(xí)收益非淺。
          希望有多一些的示例。
          順便請(qǐng)教下,
          有二個(gè)表格,a與b.
          這二者是一對(duì)多的關(guān)系,并在Hibernate中進(jìn)行了映射配置。
          現(xiàn)想依據(jù)a表查出所有數(shù)據(jù),包括與a對(duì)應(yīng)的b表中的數(shù)據(jù)。
          方法最終得要的結(jié)果類型為L(zhǎng)ist型.

          因?yàn)長(zhǎng)ist類型中,有包含a,b二表的數(shù)據(jù)。
          請(qǐng)教,這個(gè)List類型,如何在JSP頁(yè)面中顯示。
          (只顯示a中的數(shù)據(jù)沒有問(wèn)題,就是不會(huì)一同顯示b中的數(shù)據(jù))  回復(fù)  更多評(píng)論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應(yīng)用 示例代碼下載
          2007-04-20 09:50 | 海藍(lán)
          @千山鳥飛絕

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

          我在struts_products.xml中看到:

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

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

          Sorry,原來(lái)productAction這個(gè)bean是在applicationContext.xml中定義的  回復(fù)  更多評(píng)論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應(yīng)用 示例代碼下載
          2007-04-20 15:49 | 海藍(lán)
          @千山鳥飛絕

          重新測(cè)試了代碼,在我這里需要做以下修改才能運(yùn)行:
          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中各個(gè)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>
          但新增一個(gè)游戲后保存,輸入的中文均顯示為?。將相應(yīng)字段的Collation改為gbk_chinese_ci、gbk_bin都不行。不知是哪里不正確?  回復(fù)  更多評(píng)論
            
          # re: struts2.0+spring2.0+hibernate3.1 web應(yīng)用 示例代碼下載
          2007-04-20 16:05 | 千山鳥飛絕
          @海藍(lán)
          我使用的數(shù)據(jù)庫(kù)是SQLServer2000,mysql沒有測(cè)試過(guò)。

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

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


          網(wǎng)站導(dǎo)航:
           
          正在閱讀:



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

          常用鏈接

          留言簿(35)

          隨筆檔案

          文章分類

          文章檔案

          好友的blog

          我的其他blog

          老婆的Blog

          搜索

          •  

          積分與排名

          • 積分 - 776608
          • 排名 - 56

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 涞水县| 聂拉木县| 松滋市| 读书| 新安县| 南京市| 佳木斯市| 伊金霍洛旗| 永年县| 尉氏县| 江都市| 林芝县| 浑源县| 淮阳县| 阳原县| 东阳市| 甘德县| 阜城县| 密云县| 西乌珠穆沁旗| 六枝特区| 武安市| 盐池县| 天峻县| 理塘县| 上林县| 双桥区| 汉中市| 西畴县| 三穗县| 德格县| 马鞍山市| 赤城县| 台山市| 崇义县| 澜沧| 宾川县| 安阳市| 和静县| 四平市| 灵川县|