Maj informations
This commit is contained in:
@@ -8,13 +8,13 @@
|
||||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
|
||||
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.2.xsd">
|
||||
|
||||
<!-- 自动扫描所有注解(除Controller) 注册为bean (启动注解) -->
|
||||
<!-- -->
|
||||
<context:component-scan base-package="com.eshop">
|
||||
<context:exclude-filter type="annotation"
|
||||
expression="org.springframework.stereotype.Controller" />
|
||||
</context:component-scan>
|
||||
|
||||
<!--配置数据源 -->
|
||||
<!-- -->
|
||||
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
|
||||
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
|
||||
<property name="url"
|
||||
@@ -27,7 +27,7 @@
|
||||
<property name="maxWait" value="10000" />
|
||||
</bean>
|
||||
|
||||
<!--配置session工厂 -->
|
||||
<!-- -->
|
||||
<bean id="sessionFactory"
|
||||
class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
@@ -41,13 +41,13 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- 事务管理器配置 -->
|
||||
<!-- -->
|
||||
<bean id="transactionManager"
|
||||
class="org.springframework.orm.hibernate5.HibernateTransactionManager">
|
||||
<property name="sessionFactory" ref="sessionFactory" />
|
||||
</bean>
|
||||
|
||||
<!-- 启动事务注解 -->
|
||||
<!-- -->
|
||||
<tx:annotation-driven transaction-manager="transactionManager"
|
||||
proxy-target-class="true" />
|
||||
|
||||
|
@@ -9,23 +9,23 @@
|
||||
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
|
||||
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
|
||||
|
||||
<!-- 静态资源访问 -->
|
||||
<!-- -->
|
||||
<mvc:default-servlet-handler/>
|
||||
|
||||
<mvc:annotation-driven/>
|
||||
|
||||
<!-- 把标记了@Controller注解的类转换为bean -->
|
||||
<!-- 把标记了@Controller bean -->
|
||||
<context:component-scan base-package="com.eshop.controller">
|
||||
</context:component-scan>
|
||||
|
||||
<!-- ViewResolver Servlet、JSP视图解析-->
|
||||
<!-- ViewResolver Servlet、JSP-->
|
||||
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
||||
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
|
||||
<property name="prefix" value="/"/>
|
||||
<property name="suffix" value=".jsp"/>
|
||||
</bean>
|
||||
|
||||
<!-- 配置拦截器 -->
|
||||
|
||||
<!--
|
||||
<mvc:interceptors>
|
||||
<mvc:interceptor>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<welcome-file>index.jsp</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
||||
<!-- 配置spring -->
|
||||
<!-- spring -->
|
||||
<listener>
|
||||
<listener-class>
|
||||
org.springframework.web.context.ContextLoaderListener
|
||||
@@ -19,7 +19,7 @@
|
||||
<param-value>WEB-INF/spring.xml</param-value>
|
||||
</context-param>
|
||||
|
||||
<!-- 配置springMVC DispatcherServlet -->
|
||||
<!-- springMVC DispatcherServlet -->
|
||||
<servlet>
|
||||
<servlet-name>dispatcher</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
@@ -34,7 +34,7 @@
|
||||
<url-pattern>/</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<!-- 配置编码格式 -->
|
||||
<!-- -->
|
||||
<filter>
|
||||
<filter-name>CharacterEncodingFilter</filter-name>
|
||||
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
|
||||
|
Reference in New Issue
Block a user