30.SSH配置文件模板和类库.md


目录

1.struts2

1.<?xml version="1.0" encoding="UTF-8"?>2.<!DOCTYPE struts PUBLIC3.          "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"4.          "http://struts.apache.org/dtds/struts-2.0.dtd">5.<struts>6.    <!-- 这个package写法是固定的,这里的name可以随意填写 ,后面的extends必须按照格式-->7.    <package name="default" extends="struts-default">8.        <!-- action的name对应的是访问路径, class是实际的类,方法是执行的方法名 -->9.        <action name="hello" class = "per.liyue.code.struts2_demo.HelloAction" method="execute">10.            <!-- 这里result的name和对应的Action类中的返回标签一致 -->11.            <result name="success">/success.jsp</result>12.        </action> 13.    </package>14.</struts>```




StrutsDemo1 stucts2 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter stucts2 /*


# 2.Hibernate
## 2.1类配置
```
<!DOCTYPE hibernate-configuration PUBLIC        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"><!--hibernate.cfg.xml--><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
```

4.类库

附件类库是SSH基本类库,只包含了个框架基本功能。

原文地址:https://www.cnblogs.com/bugstar/p/8510163.html