s2sh配置

 hibernate

  
  
  
  
  1. <?xml version='1.0' encoding='UTF-8'?> 
  2. <!DOCTYPE hibernate-configuration PUBLIC 
  3.           "-//Hibernate/Hibernate Configuration DTD 3.0//EN" 
  4.           "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
  5.  
  6. <!-- Generated by MyEclipse Hibernate Tools.                   --> 
  7. <hibernate-configuration> 
  8.  
  9.     <session-factory> 
  10.         <property name="dialect"
  11.             org.hibernate.dialect.MySQLDialect 
  12.         </property> 
  13.         <property name="connection.url"
  14.             jdbc:mysql://localhost:3306/hzview      
  15.         </property> 
  16.         <property name="connection.username">root</property> 
  17.         <property name="connection.password">2659</property> 
  18.         <property name="connection.driver_class"
  19.             com.mysql.jdbc.Driver 
  20.         </property> 
  21.         <property name="myeclipse.connection.profile">mysql</property> 
  22.         <mapping resource="com/dao/userdao/Userinfo.hbm.xml" /> 
  23.     </session-factory> 
  24.  
  25. </hibernate-configuration> 

spring

  
  
  
  
  1. <?xml version="1.0" encoding="UTF-8"?> 
  2. <beans default-autowire="byName" 
  3.     xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  4.     xmlns:context="http://www.springframework.org/schema/context" 
  5.     xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" 
  6.     xsi:schemaLocation="http://www.springframework.org/schema/beans 
  7.         http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
  8.         http://www.springframework.org/schema/aop 
  9.         http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 
  10.         http://www.springframework.org/schema/tx 
  11.         http://www.springframework.org/schema/tx/spring-tx-3.0.xsd 
  12.         http://www.springframework.org/schema/context 
  13.         http://www.springframework.org/schema/context/spring-context-3.0.xsd"> 
  14.     <bean id="transactionManager" 
  15.         class="org.springframework.orm.hibernate3.HibernateTransactionManager"
  16.         <property name="sessionFactory"
  17.             <ref local="sessionFactory" /> 
  18.         </property> 
  19.     </bean> 
  20.      <tx:annotation-driven transaction-manager="transactionManager"/>  
  21.  
  22.     <bean id="sessionFactory" 
  23.         class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"
  24.         <property name="configLocation" 
  25.             value="classpath:hibernate.cfg.xml"
  26.         </property> 
  27.     </bean> 
  28.     <bean id="UserinfoDAO" class="com.dao.userdao.UserinfoDAO"
  29.         <property name="sessionFactory"
  30.             <ref bean="sessionFactory" /> 
  31.         </property> 
  32.     </bean> 
  33.     </beans> 

Userinfo.hbm.xml

   
   
   
   
  1. <?xml version="1.0" encoding="utf-8"?> 
  2. <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
  3. "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
  4. <!--  
  5.     Mapping file autogenerated by MyEclipse Persistence Tools 
  6. --> 
  7. <hibernate-mapping> 
  8.     <class name="com.dao.userdao.Userinfo" table="userinfo" catalog="hzview"
  9.         <id name="id" type="java.lang.Integer"
  10.             <column name="id" /> 
  11.             <generator class="increment"/> 
  12.         </id> 
  13.         <property name="loginname" type="java.lang.String"
  14.             <column name="loginname" length="225" /> 
  15.         </property> 
  16.         <property name="loginpwd" type="java.lang.String"
  17.             <column name="loginpwd" length="225" /> 
  18.         </property> 
  19.         <property name="name" type="java.lang.String"
  20.             <column name="name" length="225" /> 
  21.         </property> 
  22.         <property name="sex" type="java.lang.String"
  23.             <column name="sex" length="50" /> 
  24.         </property> 
  25.         <property name="email" type="java.lang.String"
  26.             <column name="email" length="225" /> 
  27.         </property> 
  28.         <property name="address" type="java.lang.String"
  29.             <column name="address" length="225" /> 
  30.         </property> 
  31.         <property name="selfshow" type="java.lang.String"
  32.             <column name="selfshow" length="300" /> 
  33.         </property> 
  34.         <property name="del" type="java.lang.Integer"
  35.             <column name="del" /> 
  36.         </property> 
  37.          <property name="level" type="java.lang.Integer"
  38.             <column name="level" /> 
  39.         </property> 
  40.           <property name="levelname" type="java.lang.String"
  41.             <column name="levelname" length="50" /> 
  42.         </property> 
  43.     </class
  44. </hibernate-mapping> 

Struts2

  
  
  
  
  1. <?xml version="1.0" encoding="UTF-8" ?> 
  2. <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"
  3. <struts> 
  4.     <constant name="struts.il8n.encoding" value="utf-8" /> 
  5.     <constant name="struts.multipart.maxSize" value="550000000000000" /> 
  6.     <constant name="struts.objectFactory.spring.autoWire" value="name" /> 
  7.     <constant name="struts.objectFactory" value="spring" /> 
  8.     <constant name="struts2.custom.il8n.resources" value="globalMessages" /> 
  9.  
  10.     <package name="package" extends="json-default"
  11.         <interceptors> 
  12.             <interceptor name="authority" class="com.action.user.SimpleInterceptor"></interceptor> 
  13.             <interceptor name="authority2" class="com.action.user.SimpleInterceptor2"></interceptor> 
  14.                         <interceptor name="authority0" class="com.action.user.SimpleInterceptor0"></interceptor> 
  15.              
  16.         </interceptors> 
  17.          
  18.         <global-results> 
  19.             <result name="error">/Login.jsp</result> 
  20.             <result name="input">/inputlogin.jsp</result> 
  21.         </global-results> 
  22. <action name="jaaction" class="com.action.user.JaAction"> //ajax配置
  23.             <result type="json"
  24.             </result> 
  25.         </action> 
  26. <!--        <action name="usershow" class="com.action.user.UserShowAction"
  27.             <result name="success">/usershow.jsp</result> 
  28.         </action>--> 
  29.         <action name="userdelete" class="com.action.user.UserDeleteAction"
  30.             <result name="success" type="redirectAction">listmember</result> 
  31.             <result name="error">/error.jsp</result> 
  32.             <interceptor-ref name="defaultStack"></interceptor-ref> //拦截器
  33.             <interceptor-ref name="authority"></interceptor-ref> 
  34.         </action> 
  35. <action name="*qiantai" class="com.action.qiantai.Qiantaimanage"  method="{1}"> //一个action多种方法
  36.             <result name="index">/index.jsp</result> 
  37.             <result name="articleshow">/articleshow.jsp</result> 
  38.             <result name="indexfind">/indexfind.jsp</result> 
  39.             <result name="indexfinditem">/indexfinditem.jsp</result> 
  40.         </action> 
  41.  
  42.  
  43.     </package
  44. </struts>    
  45.  

web

  
  
  
  
  1. <filter> 
  2.     <filter-name>struts2</filter-name> 
  3.     <filter-class
  4.         org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class
  5. </filter> 
  6. <filter-mapping> 
  7.     <filter-name>struts2</filter-name> 
  8.     <url-pattern>/*</url-pattern> 
  9. </filter-mapping> 

 

你可能感兴趣的:(s2sh)