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系统范围的配置文件,允许你通过设置不同的选项来改变客户端程序的运行方式.这个文件的每 ...
随机推荐
- BAT互联网公司是如何内部推荐的?
中国十大互联网公司 注:以上按照目前市值排序整理出来,当然还有更多未上市的潜力股.如:美团.豆瓣.豌豆荚.美图秀秀等等 各大互联网公司招聘官网 阿里招聘:https://job.alibaba.com ...
- java进程卡死问题
原文地址:http://stackoverflow.com/questions/28739600/jvm-hang-and-kill-3-jmap-failed tomcat进程出现了如下异常,并且卡 ...
- WordPress BuddyPress Extended Friendship Request插件跨站脚本漏洞
漏洞名称: WordPress BuddyPress Extended Friendship Request插件跨站脚本漏洞 CNNVD编号: CNNVD-201307-609 发布时间: 2013- ...
- Linux Kernel 释放后重用内存损坏漏洞
漏洞名称: Linux Kernel 释放后重用内存损坏漏洞 CNNVD编号: CNNVD-201307-305 发布时间: 2013-07-18 更新时间: 2013-07-18 危害等级: ...
- Linux Kernel 'dispatch_discard_io()'安全绕过漏洞
漏洞版本: Linux Kernel 漏洞描述: Bugtraq ID:60414 CVE ID:CVE-2013-2140 Linux是一款开源的操作系统. 由于不充分的检查BLKIF_OP_DIS ...
- 互联网组织的未来:剖析GitHub员工的任性之源
转自:http://www.php100.com/html/it/hulianwang/2015/0108/8304.html [导读] 本文为大家介绍了著名代码托管服务商GitHub的组织运转结构. ...
- Javascript 面向对象编程(一):封装 by 阮一峰
<Javascript高级程序设计(第二版)>(Professional JavaScript for Web Developers, 2nd Edition) 它们都是非常优秀的Java ...
- (转载)PHP 提示和技巧
(转载)http://www.111cn.net/phper/21/b4aea31507014a778b18682943db402f.htm 1. 当您在寻找关于某个具体的 PHP 函数的信息时,请转 ...
- Reward(拓扑排序)
http://acm.hdu.edu.cn/showproblem.php?pid=2647 题意: 老板要给n个员工发工资最低工资是888: 但是工人们是有要求的 如果输入 a b 表示a的工资要比 ...
- hdu4696 想法题
就像1.2元人民币可以凑成任意你想要的面值一样.由于一定会有环,只要有C[i] == 1 就可以造成任何数.够坑吧 #include <cstdio> #include <cstri ...