本人初级程序员,今天无聊做了个demo,此demo是SSH框架。由于太久没有搭建,前前后后也出现很多琐碎的问题,特地总结配置文件的存放和配置。
项目目录如图:
.
hibernate.cfg.xml和struts.xml放在src/main/resources目录下,applicationContext.xml则在下一层的spring。
接下里是web.xml的配置:
<?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"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-clas