常用知识点记录

来源:互联网 发布:windows经典系统桌面 编辑:程序博客网 时间:2024/06/08 08:55

struts.xml

<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"><struts>    <package name="default" namespace="/" extends="struts-default">    </package></struts>

hibernate.cfg.xml

<?xml version="1.0" encoding="UTF-8" ?><!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 >        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>          <property name="connection.url">              jdbc:mysql://localhost:3306/test?useUnicode=true          </property>          <property name="connection.username">root</property>          <property name="connection.password"></property>          <property name="show_sql">true</property>          <property name="format_sql">true</property>          <property name="dialect">org.hibernate.dialect.MySQLDialect</property>          <property name="hbm2ddl.auto">update</property>          <property name="hibernate.current_session_context_class">thread</property>    </session-factory></hibernate-configuration>

web.xml中过滤器写法

<!-- 添加struts2的过滤器 -->    <filter>        <filter-name>struts2</filter-name>        <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>    </filter>    <filter-mapping>        <filter-name>struts2</filter-name>        <url-pattern>/*</url-pattern>    </filter-mapping> 

常用项目结构(struts和hibernate框架):
实体层
数据库层
接口层
接口实现层//以上是模型层
动作层//控制层
jsp页面//视图层

0 0
原创粉丝点击