struts的配置:

struts.xml:

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

<!DOCTYPE struts SYSTEM "http://struts.apache.org/dtds/struts-2.1.7.dtd" PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN">

-<struts>

<!-- 配置action的访问路径为.do的形式 -->

<constant value="do" name="struts.action.extension"/>

<!-- 配置struts的开发模式 -->

<constant value="true" name="struts.devMode"/>

<!-- 配置struts的简单模式 -->

<constant value="simple" name="struts.ui.theme"/>

-<package name="system" extends="struts-default" namespace="/system">

<!-- 首页登录 -->

-<action name="elecMenuAction_*" method="{1}" class="cn.itcast.elec.web.action.ElecMenuAction">

<result name="home"> /WEB-INF/page/menu/home.jsp </result>

<!-- 处理验证登录失败,跳转到index.jsp -->

<result name="error"> /WEB-INF/page/menu/index.jsp </result>

<result name="title"> /WEB-INF/page/menu/title.jsp </result>

<result name="left"> /WEB-INF/page/menu/left.jsp </result>

<result name="change1"> /WEB-INF/page/menu/change1.jsp </result>

<result name="loading"> /WEB-INF/page/menu/loading.jsp </result>

<result name="alermJX"> /WEB-INF/page/menu/alermJX.jsp </result>

<result name="alermSB"> /WEB-INF/page/menu/alermSB.jsp </result>

<result name="alermXZ"> /WEB-INF/page/menu/alermXZ.jsp </result>

<result name="alermYS"> /WEB-INF/page/menu/alermYS.jsp </result>

<result name="alermZD"> /WEB-INF/page/menu/alermZD.jsp </result>

<result name="logout"> /WEB-INF/page/menu/index.jsp </result>

</action>

<!-- 代办事宜 -->

-<action name="elecCommonMsgAction_*" method="{1}" class="cn.itcast.elec.web.action.ElecCommonMsgAction">

<result name="home"> /WEB-INF/page/system/actingIndex.jsp </result>

-<result name="save" type="redirectAction">

<param name="actionName">elecCommonMsgAction_home</param>

<param name="namespace">/system</param>

</result>

</action>

<!-- 数据字典 -->

-<action name="elecSystemDDlAction_*" method="{1}" class="cn.itcast.elec.web.action.ElecSystemDDlAction">

<result name="home"> /WEB-INF/page/system/dictionaryIndex.jsp </result>

<result name="edit"> /WEB-INF/page/system/dictionaryEdit.jsp </result>

-<result name="save" type="redirectAction">

<param name="actionName">elecSystemDDlAction_home</param>

<param name="namespace">/system</param>

</result>

</action>

<!-- 用户管理 -->

-<action name="elecUserAction_*" method="{1}" class="cn.itcast.elec.web.action.ElecUserAction">

<result name="home"> /WEB-INF/page/system/userIndex.jsp </result>

<!-- 2011-12-31日修改,添加分页功能 -->

<result name="userlist"> /WEB-INF/page/system/userList.jsp </result>

<!-- 2011-12-31日修改,使用poi报表导出excel的数据 -->

<result name="export"> /WEB-INF/page/system/userIndex.jsp </result>

<!-- 2011-13-31日修改,使用jxl从excel中获取数据,导入到数据库中 -->

<result name="importpage"> /WEB-INF/page/system/userImport.jsp </result>

<result name="importdata"> /WEB-INF/page/system/userImport.jsp </result>

<!-- 2012-1-2日修改,使用Jfreechart报表统计人员 -->

<result name="chart"> /WEB-INF/page/system/userReport.jsp </result>

<result name="add"> /WEB-INF/page/system/userAdd.jsp </result>

<result name="edit"> /WEB-INF/page/system/userEdit.jsp </result>

-<result name="list" type="redirectAction">

<param name="actionName">elecUserAction_home</param>

<param name="namespace">/system</param>

</result>

</action>

<!-- 角色管理 -->

-<action name="elecRoleAction_*" method="{1}" class="cn.itcast.elec.web.action.ElecRoleAction">

<result name="home"> /WEB-INF/page/system/roleIndex.jsp </result>

<result name="edit"> /WEB-INF/page/system/roleEdit.jsp </result>

-<result name="save" type="redirectAction">

<param name="actionName">elecRoleAction_home</param>

<param name="namespace">/system</param>

</result>

</action>

<!-- 日志管理 -->

-<action name="elecLogAction_*" method="{1}" class="cn.itcast.elec.web.action.ElecLogAction">

<result name="home"> /WEB-INF/page/system/logIndex.jsp </result>

-<result name="delete" type="redirectAction">

<param name="actionName">elecLogAction_home</param>

<param name="namespace">/system</param>

</result>

</action>

-<action name="elecTextAction_*" method="{1}" class="cn.itcast.elec.web.action.ElecTextAction">

<result name="save"> /system/textAdd.jsp </result>

</action>

</package>

</struts>

hibernate的配置:

hibernate.cfg.xml:

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

<!DOCTYPE hibernate-configuration SYSTEM "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd" PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN">

-<hibernate-configuration>

-<session-factory>

<!-- <property name="hibernate.connection.username">root</property> <property name="hibernate.connection.password">root</property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/itcast1222elec</property> <property name="hibernate.connection.autocommit">true</property> -->

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

<property name="hibernate.hbm2ddl.auto">update</property>

<property name="hibernate.show_sql">true</property>

<mapping resource="cn/itcast/elec/domain/ElecText.hbm.xml"/>

<mapping resource="cn/itcast/elec/domain/ElecCommonMsg.hbm.xml"/>

<mapping resource="cn/itcast/elec/domain/ElecSystemDDl.hbm.xml"/>

<mapping resource="cn/itcast/elec/domain/ElecUser.hbm.xml"/>

<mapping resource="cn/itcast/elec/domain/ElecUserRole.hbm.xml"/>

<mapping resource="cn/itcast/elec/domain/ElecRolePopedom.hbm.xml"/>

<mapping resource="cn/itcast/elec/domain/ElecLog.hbm.xml"/>

</session-factory>

</hibernate-configuration>

spring的配置:

bean.xml:

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

-<beans xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-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/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns="http://www.springframework.org/schema/beans">

<!-- 1:配置注解的自动扫描的范围 -->

<context:component-scan base-package="cn.itcast.elec"/>

<!-- 2:配置数据源 -->

db.properties:

跟之前的配置是一样的:

jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/数据库名?characterEncoding=utf-8
jdbc.username=用户名
jdbc.password=用户密码

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

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

<property value="jdbc:mysql://localhost:3306/itcast1222elec?useUnicode=true&characterEncoding=UTF-8" name="jdbcUrl"/>

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

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

<!--连接池中保留的最小连接数。-->

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

<!--连接池中保留的最大连接数。Default: 15 -->

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

<!--初始化时获取的连接数,取值应在minPoolSize与maxPoolSize之间。Default: 3 -->

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

<!--最大空闲时间,60秒内未使用则连接被丢弃。若为0则永不丢弃。Default: 0 -->

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

<!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3 -->

<property value="5" name="acquireIncrement"/>

<!--JDBC的标准参数,用以控制数据源内加载的PreparedStatements数量。但由于预缓存的statements 属于单个connection而不是整个连接池。所以设置这个参数需要考虑到多方面的因素。 如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。Default: 0-->

<property value="0" name="maxStatements"/>

<!--每60秒检查所有连接池中的空闲连接。Default: 0 -->

<property value="60" name="idleConnectionTestPeriod"/>

<!--定义在从数据库获取新连接失败后重复尝试的次数。Default: 30 -->

<property value="30" name="acquireRetryAttempts"/>

<!--获取连接失败将会引起所有等待连接池来获取连接的线程抛出异常。但是数据源仍有效 保留,并在下次调用getConnection()的时候继续尝试获取连接。如果设为true,那么在尝试 获取连接失败后该数据源将申明已断开并永久关闭。Default: false-->

<property value="true" name="breakAfterAcquireFailure"/>

</bean>

<!-- 3:创建sessionFactory,这是spring整合hibernate的入口 -->

-<bean class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" id="sessionFactory">

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

-<property name="configLocation">

<value> classpath:hibernate.cfg.xml </value>

</property>

</bean>

<!-- 4:创建事务管理器 -->

-<bean class="org.springframework.orm.hibernate3.HibernateTransactionManager" id="txManage">

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

</bean>

<!-- 5:以注解的形式管理事务 -->

<tx:annotation-driven transaction-manager="txManage"/>

</beans>

SSH的各个配置文件:的更多相关文章

  1. 利用 ssh 的用户配置文件 config 管理 ssh 会话

    http://dhq.me/use-ssh-config-manage-ssh-session 利用 ssh 连接远程服务器,一般都要输入以下类似命令: 1 ssh user@hostname -p ...

  2. 利用ssh的用户配置文件config管理ssh会话

    通常利用 ssh 连接远程服务器,一般都要输入以下类似命令: ssh user@hostname -p port 如果拥有多个 ssh 账号,特别是像我这种喜欢在终端里直接 ssh 登陆,不用 PuT ...

  3. [转帖]SSH远程登录配置文件sshd_config详解

    SSH远程登录配置文件sshd_config详解 2016年06月02日 17:42:25 Field_Yang 阅读数 61386   版权声明:本文为博主原创文章,遵循CC 4.0 by-sa版权 ...

  4. 上,打开SSH服务的配置文件:/etc/ssh/sshd_config 加上如下两行: ClientAliveInterval 120 ClientAliveCountMax 720 第一行,表示每隔120秒向客户端

    SSH的默认过一段时间会超时,有时候正在执行着脚本,出去一会回来就断开了,输出信息都看不到了... 禁止SSH自动超时最简单的办法就是,每隔一段时间在客户端和服务器之间发送一个"空包&quo ...

  5. ssh的用户配置文件config管理ssh会话

    抄的这个: https://www.cnblogs.com/zhonghuasong/p/7236989.html 只是在这里留个存档,防止删除 我有这样的需求就是,因为需要ssh连接到服务器,然后每 ...

  6. SSH概述与配置文件说明

    一.什么是SSH? 简单说,SSH是一种网络协议,用于计算机之间的加密登录.在出现SSH之前,系统管理员需要登入远程服务器执行系统管理任务时,都是用telnet来实现的,telnet协议采用明文密码传 ...

  7. Java之ssh框架spring配置文件配置定时任务

    最近做了一个数据同步功能,要求晚上0点去定时同步数据,这是个老项目框架用的ssh,定时任务基于quartz,废话不多说,下面详细说说相关配置. 在spring的配置文件中: <!-- 0点定时任 ...

  8. ssh配置文件ssh_config和sshd_config区别

    问题描述:在一次配置ssh端口和秘钥登录过程中,修改几次都没有成功.最后发现修改的是ssh.config,原因是习惯tab一下,实在是眼拙! ssh_config和sshd_config配置文件区别: ...

  9. 由于SSH配置文件的不匹配,导致的Permission denied (publickey)及其解决方法。

    读者如要转载,请标明出处和作者名,谢谢.地址01:http://space.itpub.net/25851087地址02:http://www.cnblogs.com/zjrodger/作者名:zjr ...

随机推荐

  1. springMVC之applicationcontext.xml配置说明

    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...

  2. [转]Mybatis3.x与Spring4.x整合

    原文地址:http://www.cnblogs.com/xdp-gacl/p/4271627.html 一.搭建开发环境 1.1.使用Maven创建Web项目 执行如下命令: mvn archetyp ...

  3. [转]浅谈jQuery EasyUI的属性设置

    原文地址:http://www.easyui.info/archives/1664.html 对jQuery EasyUI有一定了解的话,应该知道基本上每一个组件都有一个"options&q ...

  4. 【BZOJ 3048】【USACO2013 Jan】Cow Lineup 滑块思想

    昨天下午想了好久没想出来,果然是很弱,思考能力低下. 用的类似单调队列的思想,维护一个长度为$k+1$的滑块,每次统计下$ans$就可以了 #include<cstdio> #includ ...

  5. 素数筛 uva 543

    给你一个n求出n由2个奇质因子的和  这2个因子差最大 没有就输出'Goldbach's conjecture is wrong. #include<stdio.h> #include&l ...

  6. C#-WinForm-跨窗体 构造函数传值 及应用—登录式窗口传值、如何关闭主页面时关闭应用程序、如何打开唯一窗口—★★★★★五星重量级

    构造函数可以传任意类型的值,并可以同时传多个值 结构函数传值的初步应用--简单的登陆式界面 现在我有两个窗体Form3和Form4,如下,如何点击Form3中的按钮后,打开Form4并将Form3中的 ...

  7. 【CodeForces 699B】One Bomb

    r[i],c[i]分别表示第i行有几个*,第i列有几个*. 枚举每个位置如果c[i]+r[j]-(本身是不是*)==总*数,则该位置即为答案. #include<cstdio> #incl ...

  8. 浏览器上网 (Safari & Chrome)

    浏览器上网 (Safari & Chrome) Command + L = 光标移到地址框 Command + R = 刷新页面 Command + + = 大屏幕的时候很实用,放大页面,基本 ...

  9. OPENGL之定时器

    定时器一般用于控制隔一段时间调用某函数 函数原型glutTimerFunc(unsigned int msecs,void(*func)(int value),int value) 说明:msecs为 ...

  10. Android Studio打包全攻略

    转载:http://www.2cto.com/kf/201606/517300.html 初出茅庐 手动打包 怎么手动打包 项目写完了,现在需要把应用上传到市场,问题出现-怎么把代码变成.apk(An ...