var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-20738293-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script')"/>

          jutleo
          歡迎走進(jìn)有風(fēng)的地方~~
          posts - 63,  comments - 279,  trackbacks - 0

          Spring2.5.3+Hibernate3.2+Struts2.0.11整合

           

           

          只有Struts2基礎(chǔ)(初學(xué)Hibernate/Spring第三天就想著整合),有些地方不是很懂,看了網(wǎng)上大部分的例子、blog,百分百的MyEclipse插件,本人不太習(xí)慣使用MyEclipse,主要是Eclipse使用的時間比較長,使用MyEclipse6.0.1時(第一次用)比如你要輸入.getHibernateTemplate()時,輸入點(diǎn)時就有提示,但是當(dāng)我輸入點(diǎn)后面的字母出錯時,只能返回到輸入點(diǎn)之前才按點(diǎn)“.”可以提示,按ALT+/也不會出現(xiàn),是不是我不知道快捷鍵,或是其它的方式,總之我在Eclipse中輸入一半錯誤時按ALT+/可以又出來提示,雖然不是特依賴提示功能,但是用起來還是不爽,畢竟每天都在使用它,哪位要是知道的話煩請告訴一聲bulktree@126.com

          僅僅看了兩天的官方文檔就寫了這個整合的新聞發(fā)布系統(tǒng),感覺蠻好的,是個好的開始 come on!


          以下是一個新聞發(fā)布系統(tǒng)的登錄模塊:(兩天看文檔,一夜寫成的,不是很完善,僅僅實現(xiàn)基本的增刪查改功能,主要是整合練習(xí))


          首先配置三個框架,有人說要是使用MyEclipse自動生成會有順序Spring->Hibernate->Struts,太依賴工具不是本人的習(xí)慣,這些是后話。
          開發(fā)工具Eclipse J2EE Developer Tomcat6.0.13 Mysql 6.0
          新建Dynamic Web Project

          拷貝工程所需的jar包到WEB-INF/lib

          數(shù)據(jù)庫創(chuàng)建腳本

          DROPTABLE context;

          CREATETABLE context

          (

              id VARCHAR(32) NOTNULLPRIMARYKEY,

              title VARCHAR(100),

              times DATETIME,

              content VARCHAR(500),

              author VARCHAR(50),

              click INT,

              typeVARCHAR(50)

          );

          DROPTABLEuser;

          CREATETABLEuser

          (

              uid VARCHAR(50) NOTNULLPRIMARYKEY,

              uname VARCHAR(50),

              password VARCHAR(50) NOTNULL

          );

          web.xml中配置Struts2Spring

          <filter>

                 <filter-name>Struts2</filter-name>

                 <filter-class>

                     org.apache.struts2.dispatcher.FilterDispatcher

                 </filter-class>

              </filter>

              <filter>

                 <filter-name>encodingFilter</filter-name>

                 <filter-class>

                     org.springframework.web.filter.CharacterEncodingFilter

                 </filter-class>

                 <init-param>

                     <param-name>encodingFilter</param-name>

                     <param-value>UTF-8</param-value>

                 </init-param>

              </filter>

              <filter-mapping>

                 <filter-name>Struts2</filter-name>

                 <url-pattern>/*</url-pattern>

              </filter-mapping>

              <listener>

                 <listener-class>

                     org.springframework.web.context.ContextLoaderListener

                 </listener-class>

              </listener>

          項目中我使用的是Tomcat數(shù)據(jù)源配置如下,如果你不使用Tomcat數(shù)據(jù)源也可以在下面的配置文件中配置:

          <Context docBase="news-SSH2" path="/news-SSH2" reloadable="true" source="org.eclipse.jst.jee.server:news-SSH2">

                        <Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" maxActive="100" maxIdle="30" maxWait="10000" name="jdbc/news" password="1234" type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/news?autoReconnect=true" username="root"/>

                     </Context>

          也在在配置applicationContext.xml文件中配置數(shù)據(jù)源

          <!-- 定義數(shù)據(jù)源Bean,使用C3P0數(shù)據(jù)源實現(xiàn) -->

              <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">

                 <!-- 指定連接數(shù)據(jù)庫的驅(qū)動 -->

                 <property name="driverClass" value="com.mysql.jdbc.Driver"/>

                 <!-- 指定連接數(shù)據(jù)庫的URL -->

                 <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/news"/>

                 <!-- 指定連接數(shù)據(jù)庫的用戶名 -->

                 <property name="user" value="root"/>

                 <!-- 指定連接數(shù)據(jù)庫的密碼 -->

                 <property name="password" value="1234"/>

                 <!-- 指定連接數(shù)據(jù)庫連接池的最大連接數(shù) -->

                 <property name="maxPoolSize" value="20"/>

                 <!-- 指定連接數(shù)據(jù)庫連接池的最小連接數(shù) -->

                 <property name="minPoolSize" value="1"/>

                 <!-- 指定連接數(shù)據(jù)庫連接池的初始化連接數(shù) -->

                 <property name="initialPoolSize" value="1"/>

                 <!-- 指定連接數(shù)據(jù)庫連接池的連接的最大空閑時間 -->

                 <property name="maxIdleTime" value="20"/>

             </bean>

          applicationContext.xml中配置sessionFactory

          <bean id="dataSource"

                  class="org.springframework.jndi.JndiObjectFactoryBean">

                 <property name="jndiName" value="java:comp/env/jdbc/news"></property>

              </bean>

              <!-- 管理Hibernate -->

              <bean id="sessionFactory"

                  class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

                 <property name="dataSource" ref="dataSource"></property>

                 <property name="mappingResources">

                     <list>

                        <value>org/bulktree/ssh2/news/vo/User.hbm.xml</value>

                        <value>org/bulktree/ssh2/news/vo/News.hbm.xml</value>

                     </list>

                 </property>

                 <property name="hibernateProperties">

                     <value>

                        hibernate.dialect=org.hibernate.dialect.MySQLDialect

                     </value>

                 </property>

              </bean>


          3.
          開始編碼:
          我們必須明確Spring框架的體系結(jié)構(gòu),新建以下幾個包

          User.java

          package org.bulktree.ssh2.news.vo;

          publicclass User {

              private String uid;

              private String uname;

              private String password;

              public String getUid() {

                 returnuid;

              }

              Getter/setter’’’’’’’’’’’

              publicvoid setPassword(String password) {

                 this.password = password;

              }

          }

          User類同包下即org.bulktree.ssh2.news.vo新建User.hbm.xml文件

          <?xml version="1.0"?>

          <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"

                                             "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

          <hibernate-mapping package="org.bulktree.ssh2.news.vo">

           <class name="User" table="user">

           <id column="uid" name="uid" type="string">

             <generator class="assigned"/>

           </id>

           <property column="uname" name="uname" type="string"/>

           <property column="password" name="password" type="string"/>

           </class>

          </hibernate-mapping>

          新建UserDao.java接口

          package org.bulktree.ssh2.news.dao;

          import java.util.List;

          import org.bulktree.ssh2.news.vo.User;

          publicinterface UserDao {

              /**

               *增加一個用戶

               *@throwsException

               */

              publicvoid addUser(User user) throws Exception;

              /**

               *根據(jù)uid/password查詢User

               *@paramuid

               *@parampassword

               *@return

               *@throwsException

               */

              public User queryByUidAndPassword(String uid, String password) throws Exception;

              /**

               *刪除用戶

               *@paramuid

               *@throwsException

               */

              publicvoid delete(String uid) throws Exception;

              /**

               *查詢?nèi)坑脩?/span>

               *@returnList

               *@throwsException

               */

              public List<User> queryAll() throws Exception;

          }



          UserDaoImpl.java接口實現(xiàn)類

          package org.bulktree.ssh2.news.dao.impl;

          import java.util.List;

          import org.bulktree.ssh2.news.dao.UserDao;

          import org.bulktree.ssh2.news.vo.User;

          import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

          /**

           * 繼承HibernateDaoSuppor類實現(xiàn)getHibernateTemplate()

           *

           * @author bulktree

           *

           */

          public class UserDaoImpl extends HibernateDaoSupport implements UserDao {

              @Override

              public void addUser(User user) throws Exception {

                 this.getHibernateTemplate().save(user);

              }

              @Override

              public void delete(String uid) throws Exception {

                 // TODO Auto-generated method stub

              }

              @Override

              public List<User> queryAll() throws Exception {

                 // TODO Auto-generated method stub

                 return null;

              }

              @Override

              public User queryByUidAndPassword(String uid, String password)

                     throws Exception {

                 String hql = "FROM User as u WHERE u.uid=? and u.password=?";

                 String[] str = new String[] { uid, password };

                 List<User> users = this.getHibernateTemplate().find(hql, str);

                 if (users != null && users.size() >= 1) {

                     return users.get(0);

                 } else {

                     return null;

                 }

              }

          }

          Service層,新建一UserService.java接口

          package org.bulktree.ssh2.news.service;

          publicinterface UserService {

              /**

               *添加一個用戶

               *@paramuid

               *@paramuname

               *@parampassword

               *@return新增用戶的uid

               *@throwsException

               */

              public String addUser(String uid, String uname, String password) throws Exception;

              /**

               *驗證登錄

               *@paramuid

               *@parampassword

               *@returnuid

               *@throwsException

               */

              public String isLogin(String uid, String password) throws Exception;

          }

          接口實現(xiàn)類

          package org.bulktree.ssh2.news.service.impl;

          import org.bulktree.ssh2.news.dao.UserDao;

          import org.bulktree.ssh2.news.service.UserService;

          import org.bulktree.ssh2.news.vo.User;

          /**

           * UserService實現(xiàn)類

           *

           * @author bulktree

           *

           */

          public class UserServiceImpl implements UserService {

              private UserDao userDao;

              public void setUserDao(UserDao userDao) {

                 this.userDao = userDao;

              }

              @Override

              public String addUser(String uid, String uname, String password)

                     throws Exception {

                 User user = new User();

                 user.setUid(uid);

                 user.setUname(uname);

                 user.setPassword(password);

                 userDao.addUser(user);

                 return user.getUid();

              }

              @Override

              public String isLogin(String uid, String password) throws Exception {

                 User user = userDao.queryByUidAndPassword(uid, password);

                 if(user != null) {

                     return user.getUname();

                 } else {

                     return null;

                 }

              }

          }

          最后我們新建一ActionLoginAction.java

          package org.bulktree.ssh2.news.action;

          import java.util.Map;

          import org.bulktree.ssh2.news.service.UserService;

          import org.bulktree.ssh2.news.vo.User;

          import com.opensymphony.xwork2.ActionContext;

          import com.opensymphony.xwork2.ActionSupport;

          /**

           * 登錄Action

           * @author bulktree

           *

           */

          public class LoginAction extends ActionSupport {

              private User user;

              private UserService userService;

              public User getUser() {

                 return user;

              }

              public void setUser(User user) {

                 this.user = user;

              }

              public UserService getUserService() {

                 return userService;

              }

              public void setUserService(UserService userService) {

                 this.userService = userService;

              }

              @Override

              public String execute() throws Exception {

                 if (isInvalid(user.getUid())) {

                     this.addFieldError("uid", "登錄ID不能為空");

                     return INPUT;

                 }

                 if (isInvalid(user.getPassword())) {

                     this.addFieldError("password", "密碼項不能為空");

                     return INPUT;

                 }

                

                 String uname = userService.isLogin(user.getUid(), user.getPassword());

                 if (uname != null) {

                     Map session = ActionContext.getContext().getSession();

                     session.put("uname", uname);

                     session.put("uid", user.getUid());

                     return SUCCESS;

                 } else {

                     this.addFieldError("idorpassword", "登錄ID或密碼錯誤");

                     return INPUT;

                 }

              }

              private boolean isInvalid(String value) {

                 return (value == null || value.length() == 0);

              }

          }

          下來就是login.jsp頁面文件了

          <center>

              <div style="color: red"><s:fielderror /><s:actionmessage /></div>

          <s:form action="login" method="post">

              <s:textfield name="user.uid" label="UID" tooltip="ENTER YOUR UID" />

              <s:password name="user.password" label="PASSWORD"

                 tooltip="ENTER YOUR PASSWORD" />

              <s:submit></s:submit>

             

          </s:form>

          <s:a href="regist.jsp">REGIST NEW COUNT</s:a></center>

          下來就是applicationContext.xml文件的配置

          <bean id="userdao" class="org.bulktree.ssh2.news.dao.impl.UserDaoImpl">

                 <property name="sessionFactory">

                     <ref bean="sessionFactory"/>

                 </property>

              </bean>

             

              <!-- bean配置 -->

              <bean id="newsdao" class="org.bulktree.ssh2.news.dao.impl.NewsDaoImpl">

                 <property name="sessionFactory">

                     <ref bean="sessionFactory"/>

                 </property>

              </bean>

              <bean id="loginAction" class="org.bulktree.ssh2.news.action.LoginAction">

                 <property name="userService">

                     <ref bean="userservice"/>

                 </property>

              </bean>

             

                  </bean>

          ·beanid屬性就是對應(yīng)類class的實例

          ·property元素的name屬性為beanclass屬性對應(yīng)類的屬性名,

          ·ref為引用bean,引用的是beanid

          Struts.xml文件完整配置

          <?xml version="1.0" encoding="UTF-8" ?>

          <!DOCTYPE struts PUBLIC

                  "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"

                  "http://struts.apache.org/dtds/struts-2.0.dtd">

          <struts>

              <constant name="struts.i18n.encoding" value="UTF-8" />

              <package name="SSH2" extends="struts-default">

                 <action name="login" class="loginAction">

                     <result>/addNews.jsp</result>

                     <result name="input">/login.jsp</result>

                 </action>

                

                 <action name="regist" class="registAction">

                     <result>/login.jsp</result>

                     <result name="input">/regist.jsp</result>

                 </action>

                

                 <action name="listall" class="listallAction">

                     <result>/newsList.jsp</result>

                     <result name="input">/addNews.jsp</result>

                 </action>

                

                 <action name="notice" class="noticeAction">

                     <result type="redirect-action">listall</result>

                     <result name="input">/addNews.jsp</result>

                 </action>

              </package>

             

          </struts>

          ·form表單的action對應(yīng)struts.xml文件中的actionname屬性,由于StrustSpring管理,struts.xml文件中的action元素class屬性對應(yīng)的是applicationContext.xml文件中bean元素id屬性

          最后貼上完整的applicationContext.xml文件

          <?xml version="1.0" encoding="UTF-8"?>

          <beans xmlns="http://www.springframework.org/schema/beans"

              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

              xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

              <!-- 使用JNDI數(shù)據(jù)源 -->

              <bean id="dataSource"

                 class="org.springframework.jndi.JndiObjectFactoryBean">

                 <property name="jndiName" value="java:comp/env/jdbc/news"></property>

              </bean>

              <!-- 管理Hibernate -->

              <bean id="sessionFactory"

                  class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

                 <property name="dataSource" ref="dataSource"></property>

                 <property name="mappingResources">

                     <list>

                        <value>org/bulktree/ssh2/news/vo/User.hbm.xml</value>

                        <value>org/bulktree/ssh2/news/vo/News.hbm.xml</value>

                     </list>

                 </property>

                 <property name="hibernateProperties">

                     <value>

                        hibernate.dialect=org.hibernate.dialect.MySQLDialect

                     </value>

                 </property>

              </bean>

             

              <bean id="userdao" class="org.bulktree.ssh2.news.dao.impl.UserDaoImpl">

                 <property name="sessionFactory">

                     <ref bean="sessionFactory"/>

                 </property>

              </bean>

             

              <!-- bean配置 -->

              <bean id="newsdao" class="org.bulktree.ssh2.news.dao.impl.NewsDaoImpl">

                 <property name="sessionFactory">

                     <ref bean="sessionFactory"/>

                 </property>

              </bean>

              <bean id="userservice" class="org.bulktree.ssh2.news.service.impl.UserServiceImpl">

                 <property name="userDao">

                     <ref bean="userdao"/>

                 </property>

              </bean>

             

              <bean id="newservice" class="org.bulktree.ssh2.news.service.impl.NewsServiceImpl">

                 <property name="newsDao">

                     <ref bean="newsdao"/>

                 </property>

              </bean>

             

              <bean id="loginAction" class="org.bulktree.ssh2.news.action.LoginAction">

                 <property name="userService">

                     <ref bean="userservice"/>

                 </property>

              </bean>

             

              <bean id="registAction" class="org.bulktree.ssh2.news.action.RegistAction">

                 <property name="userService">

                     <ref bean="userservice"/>

                 </property>

              </bean>

              <bean id="noticeAction" class="org.bulktree.ssh2.news.action.NoticeNewsAction">

                 <property name="newsService">

                     <ref bean="newservice"/>

                 </property>

              </bean>

             

              <bean id="listallAction" class="org.bulktree.ssh2.news.action.QueryAllNews">

                 <property name="newsDao">

                     <ref bean="newsdao"/>

                 </property>

              </bean>

          </beans>

          ·applicationContext.xml文件默認(rèn)加載路徑classpath下,也就是WEB-INF

          ·整個工程沒有用到hibernate.cfg.xml文件,Spring管理了hibernate,這個文件不起什么作用了,但是最好還是加上

          <?xml version="1.0" encoding="UTF-8"?>

          <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"

                                                   "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

          <hibernate-configuration>

           <session-factory>

           <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>

           <mapping class="com.bulktree.ssh2.vo.User"

             package="com.bulktree.ssh2.vo" resource="com/bulktree/ssh2/vo/User.hbm.xml"/>

           </session-factory>

          </hibernate-configuration>

          posted on 2008-04-18 13:59 凌晨風(fēng) 閱讀(8404) 評論(20)  編輯  收藏 所屬分類: Spring/Hibernate/Struts2

          FeedBack:
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合
          2008-04-18 14:19 | 凌晨風(fēng)
          *順便說一下,只是初學(xué),第一次整合,多多批評指教。
          *還有一問題,我在一個action類里寫好幾個方法execute***方法,在struts.xml文件中通過method屬性匹配,要是整合Spring,我該怎么處理多方法的action,在application中該怎么配置?
          *系統(tǒng)沒有分頁,哪位能給個高效分頁的整合代碼看看?本人不勝感激!  回復(fù)  更多評論
            
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合
          2008-04-18 14:42 | wellfuls
          你的學(xué)習(xí)態(tài)度很好,思路也對,你說的那幾個問題其實不是問題,多百度一下,就行了.祝你越來越強(qiáng).------過路人.  回復(fù)  更多評論
            
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合
          2008-04-18 15:48 | 落Nicety
          1。快捷鍵的問題,Myeclipse 下應(yīng)該是 ctrl+space 不過這個快捷鍵與輸入法切換有沖突,最好改下。
          2.應(yīng)該可以配置成spring代理 struts的的action

          路過~~  回復(fù)  更多評論
            
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合[未登錄]
          2008-04-18 15:51 | jones
          第一:eclipse中的所有快捷鍵都能自己在首選項中設(shè)置,包括內(nèi)容輔助快捷鍵
          第二:spring還沒有入門,業(yè)務(wù)方法上竟然沒有應(yīng)用事務(wù)  回復(fù)  更多評論
            
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合
          2008-04-18 16:55 | 王能
          今天SEO大賽關(guān)于西藏的問題,大家說說有沒有什么想法啊?
          關(guān)于西藏的問題,可以參考 http://www.bt285.cn/tibetisxizang 這里  回復(fù)  更多評論
            
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合
          2008-04-19 13:09 | 王者之風(fēng)
          解決方法:window(窗口)--preference(選項)---General(普通)---keys(鍵)在右邊窗口下找到Content assistant(內(nèi)容輔助)將其快捷鍵改掉就行了(隨便你怎么改,只要不沖突就行了^-^)  回復(fù)  更多評論
            
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合
          2008-04-21 07:43 | opas
          呵呵,寫得不錯,學(xué)了個東西

          <filter>

          <filter-name>encodingFilter</filter-name>

          <filter-class>

          org.springframework.web.filter.CharacterEncodingFilter

          </filter-class>

          <init-param>

          <param-name>encodingFilter</param-name>

          <param-value>UTF-8</param-value>

          </init-param>

          </filter>
            回復(fù)  更多評論
            
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合
          2008-09-08 02:32 | 過路者
          寫的不錯,思路清晰!  回復(fù)  更多評論
            
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合
          2008-09-17 14:37 | 游客
          希望你能把你的完整的源代碼以附件的形式貼出來!!謝謝!!  回復(fù)  更多評論
            
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合
          2008-09-18 14:29 | 游客
          麻煩把你的全部代碼給我發(fā)份!謝謝!!
          郵箱:cjb125@163.com  回復(fù)  更多評論
            
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合
          2008-09-24 11:27 | 路過
          寫的不錯,初學(xué)能寫成這樣的確不錯。Hibernate跟Spring的東西還有很多需要學(xué)習(xí),祝你越來越好。路過...  回復(fù)  更多評論
            
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合
          2008-09-25 12:10 | 凌晨風(fēng)
          項目源碼下載地址,很久都沒有做這些,現(xiàn)在參與一個金融項目,有什么問題大家互相交流
          http://www.aygfsteel.com/Files/bulktree/news-SSH2.rar  回復(fù)  更多評論
            
          # 編譯器代碼輔助鍵
          2009-01-27 00:42 | NoName
          Ctrl+Space 是大部分編譯器代碼輔助的默認(rèn)鍵 ,
          但與windows輸入法切換沖突。
          先右鍵輸入法圖標(biāo) ,點(diǎn)建設(shè)置 ,把Ctrl+Space換成別的。
          我一般用Ctrl+Shift+0,切換搜狗拼音
          我一般用Ctrl+Shift+9,切換Windows拼音
          比Ctrl+shift好
            回復(fù)  更多評論
            
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合
          2009-02-25 20:27 | 風(fēng)無極
          咋不弄運(yùn)行啊 報錯了 我的環(huán)境是myeclipse5.1 tomcat 5.5 jdk1.5
          嚴(yán)重: Error filterStart
          2009-2-25 20:02:52 org.apache.catalina.core.StandardContext start
          嚴(yán)重: Context [/news-SSH2] startup failed due to previous errors
          2009-2-25 20:02:52 org.springframework.context.support.AbstractApplicationContext doClose

          望大家指教啦 謝謝  回復(fù)  更多評論
            
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合[未登錄]
          2009-02-26 10:52 | cn-done
          @凌晨風(fēng)
          依然還是在Struts.xml中配置method 在action節(jié)點(diǎn)中設(shè)置不同的method方法,相同的class,不同的name

          在applicationContext.xml中針對class 設(shè)置相關(guān)的service就對了

            回復(fù)  更多評論
            
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合
          2009-03-10 09:53 | 龍華城
          路過,學(xué)習(xí)了,代碼還沒看,先看的評論,應(yīng)該不錯,你的博客收藏了.希望還會有更多的好東西分享.  回復(fù)  更多評論
            
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合
          2009-03-10 10:45 | 凌晨風(fēng)
          現(xiàn)在回過頭來在看以前寫的東西真是太簡單了,有時間重新寫一篇整合的,這些都是很基礎(chǔ)啊  回復(fù)  更多評論
            
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合
          2009-03-30 10:42 | 路過
          @風(fēng)無極
          應(yīng)該是你引用的包有問題,struts2 有基本的幾個包就可以了,core,struts2-spring-plugin commons-fileupload,commons-io,xwork,struts2.jar 在加上spring 的幾個包和hibernate3.jar  回復(fù)  更多評論
            
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合[未登錄]
          2009-06-03 16:38 | Harold.Zhang
          struts.objectFactory=spring源碼中沒有,好像不能跑吧!  回復(fù)  更多評論
            
          # re: Spring2.5.3+Hibernate3.2+Struts2.0.11整合
          2009-12-23 16:25 | Mr.Kin
          最關(guān)鍵的jar包清單 沒有加上..有空加上吧..很多人不是因為配置問題.而是因為jar出問題  回復(fù)  更多評論
            

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


          網(wǎng)站導(dǎo)航:
          博客園   IT新聞   Chat2DB   C++博客   博問  
           

          <2008年4月>
          303112345
          6789101112
          13141516171819
          20212223242526
          27282930123
          45678910

          常用鏈接

          留言簿(11)

          我參與的團(tuán)隊

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          新聞分類

          新聞檔案

          收藏夾

          圍脖

          最新隨筆

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 平舆县| 远安县| 恭城| 和林格尔县| 贵德县| 宜兴市| 安福县| 宣化县| 大港区| 白河县| 汉川市| 武义县| 威宁| 旬邑县| 修文县| 淄博市| 棋牌| 博乐市| 滨州市| 抚宁县| 渑池县| 托里县| 淮阳县| 个旧市| 灯塔市| 休宁县| 岗巴县| 新沂市| 衡东县| 营山县| 威宁| 武邑县| 阳曲县| 定远县| 漳州市| 威海市| 潍坊市| 临漳县| 西乡县| 柳州市| 涡阳县|