锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国内福利写真片视频在线,亚洲国产日韩综合久久精品,一区二区三区久久精品http://www.aygfsteel.com/supercrsky/category/27520.html涓撴敞浜嶫avaWeb寮鍙?/description>zh-cnMon, 14 Jan 2008 06:37:06 GMTMon, 14 Jan 2008 06:37:06 GMT60MyEclipse6.0.1鏁村悎Spring2.0+Struts1.2+Hibernate3.2http://www.aygfsteel.com/supercrsky/articles/174800.html銆呬笂鍠勮嫢姘淬?/dc:creator>銆呬笂鍠勮嫢姘淬?/author>Sat, 12 Jan 2008 06:00:00 GMThttp://www.aygfsteel.com/supercrsky/articles/174800.htmlhttp://www.aygfsteel.com/supercrsky/comments/174800.htmlhttp://www.aygfsteel.com/supercrsky/articles/174800.html#Feedback0http://www.aygfsteel.com/supercrsky/comments/commentRss/174800.htmlhttp://www.aygfsteel.com/supercrsky/services/trackbacks/174800.html 鍔犺澆妗嗘灦鏀寔鐨勯『搴忔槸:
Spring,Hibernate,Struts.

鍏堝姞杞絊pring鏀寔.
 
娉ㄦ剰鍦ㄨ繖閲屼竴瀹氳鎶奌ibernate3.2 Core 鍖呭姞鍏?褰撶劧濡傛灉鎮ㄩ渶瑕?br /> 鐢ㄦ敞瑙f潵綆$悊VO鐨勮瘽,涔熼渶瑕佸姞鍏ibernate 3.2 Annotations鍖?
Hibernate 3.2 Advanced鍙?

娉ㄦ剰鍦ㄤ笅涓姝ョ殑鏃跺?鎶奱pplicationContext.xml鏀懼湪/WEB-INF涓?褰撶劧
榪欎笉鏄繀欏葷殑,涓嶈繃鏀懼湪榪欓厤緗柟渚夸簺.

絎簩姝?鍔犲叆Hibernate鏀寔:
 
鍦ㄥ姞杞絟ibernate鏀寔鏃跺欐敞鎰廐ibernate3.1鐨勫寘鍦ㄨ繖閲屼笉閫?(鍚﹀垯鏈夊啿紿?
瀵逛簬Spring Persistence 鎸佷箙鍖栫殑鍖呭彲閫?

鏈鍚庡姞杞絊truts1.2鏀寔,姣旇緝綆鍗?灝變笉甯栧浘浜?
鍙娉ㄦ剰浜嗗浘涓殑涓や釜闂,涓鑸氨涓嶄細鍑虹幇鑾悕濂囧鐨?br /> Servlet Action is not Assiable 鐨勫紓甯鎬簡.

緇欏嚭閮ㄥ垎閰嶇疆鏂囦歡婧愮爜:
struts-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">

<struts-config>
    
<data-sources />
    
<form-beans />
    
<global-exceptions />
    
<global-forwards />
    
<action-mappings>
        
<action path="/login" parameter="method">
            
<forward name="ok" path="/ok.jsp" />
        
</action>
    
</action-mappings>
    
<message-resources parameter="com.web.struts.ApplicationResources" />
    
<!-- 鎺у埗鍣?nbsp;-->
    
<controller
        
processorClass="org.springframework.web.struts.DelegatingRequestProcessor" />
    
<!-- struts,spring闆嗘垚鎻掍歡 -->
    
<plug-in
        
className="org.springframework.web.struts.ContextLoaderPlugIn">
        
<set-property property="contextConfigLocation"
            value
="/WEB-INF/applicationContext.xml" />
    
</plug-in>
</struts-config>


Web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
  
<!-- spring閰嶇疆 -->
  
<context-param>
      
<param-name>contextConfigLocation</param-name>
      
<param-value>/WEB-INF/applicationContext.xml</param-value>
  
</context-param>
  
<servlet>
      
<servlet-name>context</servlet-name>
      
<servlet-class>org.springframework.web.struts.ContextLoaderPlugIn</servlet-class>
  
</servlet>
  
<!-- struts閰嶇疆 -->
  
<servlet>
    
<servlet-name>action</servlet-name>
    
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    
<init-param>
      
<param-name>config</param-name>
      
<param-value>/WEB-INF/struts-config.xml</param-value>
    
</init-param>
    
<init-param>
      
<param-name>debug</param-name>
      
<param-value>3</param-value>
    
</init-param>
    
<init-param>
      
<param-name>detail</param-name>
      
<param-value>3</param-value>
    
</init-param>
    
<load-on-startup>0</load-on-startup>
  
</servlet>
  
<servlet-mapping>
    
<servlet-name>action</servlet-name>
    
<url-pattern>*.do</url-pattern>
  
</servlet-mapping>
  
<welcome-file-list>
    
<welcome-file>index.jsp</welcome-file>
  
</welcome-file-list>
</web-app>


褰撶劧瀵逛簬web.xml涓殑spring閰嶇疆涓嶆槸蹇呴』鐨?鍙?.

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">


    
<bean id="dataSource"
        class
="org.springframework.jdbc.datasource.DriverManagerDataSource">
        
<property name="driverClassName"
            value
="com.mysql.jdbc.Driver">
        
</property>
        
<property name="url" value="jdbc:mysql://localhost/test"></property>
        
<property name="username" value="root"></property>
        
<property name="password" value="root"></property>
    
</bean>
    
<bean id="sessionFactory"
        class
="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        
<property name="dataSource">
            
<ref bean="dataSource" />
        
</property>
        
<property name="hibernateProperties">
            
<props>
                
<prop key="hibernate.dialect">
                    org.hibernate.dialect.MySQLDialect
                
</prop>
            
</props>
        
</property>
    
</bean>
    
<bean name="/login" class="com.web.struts.action.LoginAction">
    
</bean>
    
</beans>

褰撶劧鍐欎簡涓涓狶oginAction榪涜浜嗘祴璇?涓鍒囪〃鐜拌壇濂?
瀵逛簬LoginAction鍜屽墠鍙伴〉灝變笉璐村嚭婧愮爜浜?姣旇緝綆鍗?
婧愮爜涓嬭澆

]]>
Struts2+Spring2+Hibernate3鏁村悎鐨凷essionFactory寮傚父瑙e喅鍔炴硶http://www.aygfsteel.com/supercrsky/articles/164090.html銆呬笂鍠勮嫢姘淬?/dc:creator>銆呬笂鍠勮嫢姘淬?/author>Thu, 29 Nov 2007 11:43:00 GMThttp://www.aygfsteel.com/supercrsky/articles/164090.htmlhttp://www.aygfsteel.com/supercrsky/comments/164090.htmlhttp://www.aygfsteel.com/supercrsky/articles/164090.html#Feedback0http://www.aygfsteel.com/supercrsky/comments/commentRss/164090.htmlhttp://www.aygfsteel.com/supercrsky/services/trackbacks/164090.html鏄ㄥぉ鍦ㄦ暣鍚堢殑鏃跺欏嚭鐜頒簡榪欎釜寮傚父.
涓ラ噸: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 
'sessionFactory' defined in file [E:\program\Tomcat 6.0\webapps\car\WEB-INF\classes\spring\applicationContext.xml]: Invocation of init method failed;
鍦╣oogle涓婃壘浜嗗崐澶?涔熸病鎵懼埌瑙e喅鍔炴硶.
浠婂ぉ緇堜簬瑙e喅浜?鏄痡ar鍖呭啿紿佺殑闂.

鍒犳帀asm1.2.jar,鍒犳帀榪欎釜甯︾増鏈彿鐨勫氨娌¢棶棰樹簡.
榪欎釜鏂囦歡鏈変袱涓竴涓笉甯︾増鏈彿,淇濈暀閭d釜涓嶅甫鐗堟湰鍙風殑灝卞彲浠ヤ簡.

鍙戠幇鍦ㄥ嚭寮傚父鏅?鏈濂藉厛鎶婂紓甯鎬粩緇嗙殑璇繪噦,榪欐牱闂鎵嶅鏄撹В鍐?
鍛靛懙.


]]>
主站蜘蛛池模板: 兴山县| 织金县| 谷城县| 棋牌| 渭南市| 天全县| 泰和县| 吴堡县| 象山县| 八宿县| 四平市| 会同县| 韶山市| 剑阁县| 开江县| 云龙县| 加查县| 安多县| 固始县| 蓬莱市| 德昌县| 贵州省| 新宁县| 泗阳县| 丰台区| 海晏县| 阳山县| 宣汉县| 金门县| 汉中市| 郸城县| 大厂| 松溪县| 毕节市| 大兴区| 武鸣县| 台北县| 海盐县| 丽水市| 罗甸县| 三江|