MVC呢,现在似乎越来越流行使用SpringMVC框架,我自己用的感觉,是非常好,确实很舒服,配置一开始是麻烦了一点点,但是后续的开发真的是很清爽!

 

SpringMVC配置文件


目录:resource/config/spring,文件名:spring-mvc.xml

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <beans xmlns="http://www.springframework.org/schema/beans"
 3        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 4        xmlns:context="http://www.springframework.org/schema/context"
 5        xmlns:mvc="http://www.springframework.org/schema/mvc"
 6        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
 7 
 8     <!--自动扫描控制器-->
 9     <context:component-scan base-package="com.magic.rent.controller"/>
10     <!--视图渲染-->
11     <bean id="internalResourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
12         <property name="prefix" value="/WEB-INF/views/"/>
13         <property name="suffix" value=".jsp"/>
14     </bean>
15     <!--控制器映射器和控制器适配器-->
16     <mvc:annotation-driven/>
17 </beans>
spring-mvc.xml

相关文章:

  • 2021-07-28
  • 2021-11-30
  • 2021-06-21
  • 2021-11-22
  • 2021-07-10
  • 2021-12-23
  • 2021-05-23
  • 2021-07-25
猜你喜欢
  • 2021-04-12
  • 2021-12-02
  • 2021-12-02
  • 2021-10-18
  • 2021-06-04
  • 2022-12-23
相关资源
相似解决方案