ssh 配置信息

applicationContent.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"
    xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
                    http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
                    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"
    default-lazy-init="true">
   
    <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="location">
            <value>classpath:jdbc.properties</value>
        </property>
    </bean>   
    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
        <property name="driverClass" value="com.mysql.jdbc.Driver" />
        <property name="jdbcUrl" value="${jdbc.url}" />
        <property name="user" value="${jdbc.username}" />
        <property name="password" value="${jdbc.password}" />
        <property name="autoCommitOnClose" value="true"/>
        <property name="checkoutTimeout" value="${cpool.checkoutTimeout}"/>
        <property name="initialPoolSize" value="${cpool.minPoolSize}"/>
        <property name="minPoolSize" value="${cpool.minPoolSize}"/>
        <property name="maxPoolSize" value="${cpool.maxPoolSize}"/>
        <property name="maxIdleTime" value="${cpool.maxIdleTime}"/>
        <property name="acquireIncrement" value="${cpool.acquireIncrement}"/>
        <property name="maxIdleTimeExcessConnections" value="${cpool.maxIdleTimeExcessConnections}"/>
    </bean>
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <property name="mappingDirectoryLocations">
            <list>
            <value>classpath:/com/jeecms/core/entity</value>
            <value>classpath:/com/jeecms/cms/entity</value>
            <value>classpath:/com/jeecms/article/entity</value>
            <value>classpath:/com/jeecms/download/entity</value>
            <value>classpath:/com/jeecms/auxiliary/entity</value>
            </list>
        </property>
        <property name="hibernateProperties">
            <value>
            hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
            hibernate.query.substitutions=true 1, false 0
            hibernate.jdbc.batch_size=20
            hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider
            hibernate.cache.provider_configuration_file_resource_path=/ehcache-hibernate.xml
            </value>
        </property>
        <property name="entityInterceptor">  
            <ref local="treeInterceptor"/>
        </property>
    </bean>
    <bean id="treeInterceptor" class="com.jeecms.common.hibernate3.TreeIntercptor"/>
    <!-- 事务配置 -->
    <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory" />
    </bean>

    <!-- 使用annotation 自动注册bean,并检查@Required,@Autowired的属性已被注入 -->
    <context:component-scan base-package="com.jeecms" />
   
    <!-- 使用annotation定义事务 -->
    <tx:annotation-driven transaction-manager="txManager" />
</beans>
 

struts.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
    "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
	<!--登录-->
	<package name="cms.login" namespace="/login" extends="core-default">
		<global-results>
			<result name="logout" type="redirectAction">
				<param name="namespace">/login</param>
				<param name="actionName">Jeecms</param>
			</result>
			<result name="loginInput"  type="freemarker">/WEB-INF/cms_sys/login.html</result>
		</global-results>
		<action name="Jeecmsa" method="loginInput" class="cms.adminLoginAct"/>
		<action name="CmsLogout" method="logout" class="cms.adminLoginAct"/>
		<action name="CmsSubmit" method="login" class="cms.adminLoginAct" >
			<result name="success" type="redirectAction">
				<param name="actionName">Com_index</param>
				<param name="namespace">/admin/cms</param>
			</result>
		</action>
	</package>
	<!--后台首页-->
	<package name="cms.console" namespace="/admin/cms" extends="core-default">
		<action name="Com_*" method="{1}" class="cms.adminConsoleAct">
			<result name="index">/WEB-INF/cms_sys/index.html</result>
			<result name="main">/WEB-INF/cms_sys/main.html</result>
			<result name="left">/WEB-INF/cms_sys/left.html</result>
			<result name="right">/WEB-INF/cms_sys/right.html</result>
		</action>
	</package>
</struts>
 

猜你喜欢

转载自zac110.iteye.com/blog/1115490