Spring之——Spring Web基于JavaConfig类配置 的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"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<!-- 配置spring监听器 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextClass</param-name>
<param-value>
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>com.chwl.medical.utils.config.SpringContextConfig</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>
<servlet>
<servlet-name>SpringMVC</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextClass</param-name>
<param-value>
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
</param-value>
</init-param>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>com.chwl.medical.utils.config.SpringMVCConfig</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>SpringMVC</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
相关推荐
SpringMVC入门项目搭建JavaConfig配置方式(零XML)
使用JavaConfig搭建SpringMVC实现零XML配置
spring-javaconfig-reference
spring-javaconfig-reference Spring JavaConfig Reference Guide Version 1.0.0.m3 Copyright © 2005-2008 Rod Johnson, Costin Leau, Chris Beams About this document 1. Document structure Part I, “Introduction” Introduces JavaConfig, including a quick start tutorial. The impatient should start here! Part II, “API Reference” Provides a feature-by feature walk through the JavaConfig API Part III, “Appendices” Covers tooling and other practical considerations not well-suited for the core documentation 2. Target audience This document assumes at least a general familiarity with the Spring IoC container. If you are brand new to Spring (i.e.: have never used Spring's XML configuration language, it is suggested that you first read Chapter 3. IoC of the Core Spring reference manual documentation. You will also notice that this chapter is frequently referenced throughout this document. 3. Code conventions Code artifacts will be referred to in fixed-with font. Spring
spring无web.xml零配置
spring无web.xml零配置,使用javaconfig来进行spring配置,本项目使用maven管理,
spring-hibernate-gradle-multi-module:使用 Gradle 多模块的带有 Hibernate 的 Spring MVC(JavaConfig 和 XML Config)项目
spring-hibernate-gradle-多模块 使用 Gradle 多模块的带有 Hibernate 的 Spring MVC(JavaConfig 和 XML Config)项目
SpringMVC+JPA+Freeemarker 纯javaConfig,无xml配置
消灭了xml配置,转为javaConfig配置类,Spring4.3.12,前端freemarker,持久层JPA


