30.SSH配置文件模板.md
目录
1.struts2
<?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>
<!-- 这个package写法是固定的,这里的name可以随意填写 ,后面的extends必须按照格式-->
<package name="default" extends="struts-default">
<!-- action的name对应的是访问路径, class是实际的类,方法是执行的方法名 -->
<action name="hello" class = "per.liyue.code.struts2_demo.HelloAction" method="execute">
<!-- 这里result的name和对应的Action类中的返回标签一致 -->
<result name="success">/success.jsp</result>
</action>
</package>
</struts>
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>StrutsDemo1</display-name>
<!-- 引入struts核心过滤器 -->
<!-- 其实就是配置一个普通的过滤器 -->
<filter>
<!-- struts2引入 -->
<filter-name>stucts2</filter-name>
<!-- 核心类:StrutsPrepareAndExecuteFilter。可以用ctrl + shift + t中输入 -->
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter </filter-class>
</filter>
<filter-mapping>
<!-- struts2引入 -->
<filter-name>stucts2</filter-name>
<!-- 过滤所有网页 -->
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
2.Hibernate
2.1类配置
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!-- Generated Nov 9, 2006 6:27:53 PM by Hibernate Tools 3.2.0.beta7 -->
<!-- package:类对象所在的包
auto-import:表面是自动导入包,如果设定为false,则需要在执行hql语句时候将包名写清楚:
Demo:在true时候可以写为session.createQuery("from Employee").list();
在false时候必须写为session.createQuery("from per.liyue.code.hibernatehello.Employee").list();
-->
<hibernate-mapping package="per.liyue.code.hibernatehello" auto-import="true">
<!-- 类与表的对应
name:类名称
table:表名称
-->
<class name="Employee" table="employee">
<!-- 主键 注意和类成员和表列名称的一致对应 -->
<id name="empId" column="EmpId" >
<!-- 主键的生成策略:
1.identity 自增长(mysql,db2)
2.sequence 自增长(序列), oracle中自增长是以序列方法实现
3.native 自增长【会根据底层数据库自增长的方式选择identity或sequence】
如果是mysql数据库, 采用的自增长方式是identity
如果是oracle数据库, 使用sequence序列的方式实现自增长
4.increment 自增长(会有并发访问的问题,一般在服务器集群环境使用会存在问题。)
5.assigned 指定主键生成策略为手动指定主键的值
6.uuid 指定uuid随机生成的唯一的值
7.foreign (外键的方式, one-to-one讲)
-->
<generator class="native" />
</id>
<!-- 非主键,同样一一映射
name:类的属性名称
column:表的字段名称
length:设定字段的长度,默认为255
type:设定映射表的类型,如果不写匹配类对应属性的类型
java类型:必须带完整包名:java.lang.String
hibernate类型:全部都是小写
-->
<property name="empName" column="EmpName"></property>
<property name="workDate" column="WorkDate"></property>
</class>
</hibernate-mapping>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory name="foo">
<!-- 数据库连接配置 -->
<!-- 连接类 -->
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<!-- 连接数据库 -->
<property name="hibernate.connection.url">jdbc:mysql:///hi</property>
<!-- 连接用户名 -->
<property name="hibernate.connection.username">root</property>
<!-- 连接密码 -->
<property name="hibernate.connection.password">root</property>
<!-- 数据库方言 -->
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
<!-- 加载所有的映射 -->
<mapping resource="per/liyue/code/hibernatehello/Employee.hbm.xml"/>
</session-factory>
</hibernate-configuration>
3.Spring
<?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:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
</beans>
30.SSH配置文件模板.md的更多相关文章
- 30.SSH配置文件模板和类库.md
目录 1.struts2 4.类库 1.struts2 1.<?xml version="1.0" encoding="UTF-8"?>2.< ...
- ssh框架中spring整合hibernate的配置文件模板(带详细注释)
applicationContext.xml的配置文件模板 <?xml version="1.0" encoding="UTF-8"?> <b ...
- Linux安装RabbitMQ教程(文件下载地址+安装命令+ 端口开放 + 用户创建 +配置文件模板+端口修改)
前言 1.安装RabbitMQ前需先安装erlang, 且两者需要版本对应, 否则无法正常启动RabbitMQ (本教程使用22.0.7版本的erlang和3.8.6版本的Rabbitmq) 版本对应 ...
- 在Eclipse中制作SSH配置文件提示插件
原文地址:http://blog.csdn.net/longyuhome/article/details/8968093 这篇博客算是对原先的“在Eclipse中制作和使用struts2配置文件提示插 ...
- 由于SSH配置文件的不匹配,导致的Permission denied (publickey)及其解决方法。
读者如要转载,请标明出处和作者名,谢谢.地址01:http://space.itpub.net/25851087地址02:http://www.cnblogs.com/zjrodger/作者名:zjr ...
- ssh 配置文件讲解大全 ssh调试模式 sftp scp strace进行调试 特权分离
ssh 配置文件讲解大全 ssh调试模式 sftp scp strace进行调试 特权分离 http://blog.chinaunix.net/uid-16728139-id-3265394.h ...
- SSH配置文件和SSM配置文件的写法
一.SSH配置文件的写法(XML版本) <util:properties id="jdbc" location="classpath:db.properties&q ...
- 001.SSH配置文件
一 ssh配置文件路径 1.1 ssh客户端配置文件: 路径:/etc/ssh/ssh_config 1.2 ssh服务端配置文件: 路径:/etc/ssh/sshd_config 二 服务器端常用配 ...
- ssh配置文件说明
配置“/etc/ssh/ssh_config”文件 “/etc/ssh/ssh_config” 文件是OpenSSH系统范围的配置文件,允许你通过设置不同的选项来改变客户端程序的运行方式.这个文件的每 ...
随机推荐
- 14.5.2.3 Consistent Nonlocking Reads 一致性非锁定读
14.5.2.3 Consistent Nonlocking Reads 一致性非锁定读 一致性读意味着 InnoDB 使用多版本来实现一个查询数据库的快照在某个时间点. 查看看到的事务做出的改变被提 ...
- Powerful Regex
Online test Regex http://rubular.com An example src="http:\/\/localhost:3000\/preveiw-tool\/iph ...
- updatepanel刷新后重新加载js脚本问题
在页尾加 <script type="text/javascript"> Sys.WebForms.PageRequestManager.getInstance().a ...
- Keepalived实现Redis Failover
一.环境说明 操作系统版本:RHEL 5.4_64 redis版本:2.8.17 keepalived版本:1.1.15 master:10.142.130.81 slave: 10.142.130 ...
- 【转】文件读写NDK(或Linux)
原文网址:http://www.ithao123.cn/content-10709539.html 使用NDK进行文件读写,有利于保存数据的安全性,项目需要,要文件读写从Java中处理搬到Linux平 ...
- winsock 收发广播包
☛广播包的概念 广播包通常为了如下两个原因使用:1 一个应用程序希望在本地网络中找到一个资源,而应用程序对于该资源的地址又没有任何先验的知识. 2 一些重要的功能,例如路由要求把它们的信息发送给所有找 ...
- 【树状数组】CSU 1811 Tree Intersection (2016湖南省第十二届大学生计算机程序设计竞赛)
题目链接: http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1811 题目大意: 一棵树,N(2<=N<=105)个节点,每个节点有一种颜 ...
- cf702A Maximum Increase
A. Maximum Increase time limit per test 1 second memory limit per test 256 megabytes input standard ...
- Ignoring a Test
如果我们不想让某个测试失败,我们仅仅想要忽略它,那么我们可以暂时的disable它. 有三种方法来忽略一个测试: 把方法注释掉 删除 @Test 注释 增加 @Ignore注释: @Ignore([i ...
- Linux 数学运算
let 命令 a= b= let c=a+B echo $c let a++ let b++ echo $a $b []方法 a= b= echo $[a+b] echo $[$a+$b] (()) ...