SSH三大框架需要的配置文件

1. Struts2框架
  * 在web.xml中配置核心的过滤器

<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>

  * 在src目录下创建struts.xml,用来配置Action

2. Hibernate框架
  * 在src目录创建hibernate.cfg.xml配置文件
  * 在JavaBean所在的包下映射的配置文件

3. Spring框架
  * 在web.xml配置整合WEB的监听器

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>

  * 在src目录下创建applicationContext.xml
  * 在src目录下log4j.proerties

原文地址:https://www.cnblogs.com/wyhluckdog/p/10139166.html