springMVC配置文件位置及名称

在web.xml文件内配置springMVC的DispatcherServlet的那个servlet内添加

<servlet>
      <servlet-name>mvc</servlet-name>
      <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
      <init-param>
          <param-name>contextConfigLocation</param-name>
          <param-value>classpath:mvc.xml</param-value>
      </init-param>
  </servlet>

后,即可把springMVC的配置文件放在src目录下。原来的配置文件名默认为[servlet name]-servlet.xml,配置过classpath:mvc.xml后,配置文件名为mvc.xml

时间: 2024-07-31 19:35:14

springMVC配置文件位置及名称的相关文章

自定义spring配置文件位置

spring配置文件 springtest.xml  转移位置 看web.xml配置文件位置 <!-- springMVC 配置 --> <servlet> <servlet-name>springMVC</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <!-- 可以自定义servlet

LNMP安装目录及配置文件位置

LNMP相关软件安装目录Nginx 目录: /usr/local/nginx/MySQL 目录 : /usr/local/mysql/MySQL数据库所在目录:/usr/local/mysql/var/MariaDB 目录 : /usr/local/mariadb/MariaDB数据库所在目录:/usr/local/mariadb/var/PHP目录 : /usr/local/php/PHPMyAdmin目录 : 0.9版本为/home/wwwroot/phpmyadmin/ 1.0及以后版本为

新建springmvc配置文件

新建spring或springmvc的配置文件时,需要先加入spring-bean-4.3.18.RELEASE.jar包,当然可以是其他版本,这样就可以在资源目录下,比如resources(Resources Root类型)目录下右键New->XML Configuration File 选择Spring Config 只有加入了spring-bean-4.3.18.RELEASE.jar包或依赖才会有Spring Config这个选项 新建成的springmvc配置文件springmvc-s

web.xml中配置spring监听器和spring配置文件位置

<!-- spring配置文件位置 --> <context-param>  <param-name>contextConfigLocation</param-name>  <param-value>classpath:applicationContext.xml</param-value> </context-param> <!-- spring核心监听器 --> <listener>  <

Log4j配置文件位置+Spring中数据源配置文件位置

一.Log4j配置文件位置 1.自动加载 应用程序启动时,默认情况下会到src目录下寻找log4j.xml配置文件,若不存在,会继续寻找log4j.properties文件,只要找到其中一个就会加载该配置文件内容. 2.手动加载 如果将log4j.properties(或log4j.xml)放到其它目录下,比如下图中的位置,应用程序就不能自动加载log4j的配置文件了,因为应用程序找不到该配置文件,你需要手动加载. 需要在应用程序启动的代码中加入如下的代码: //加载config文件夹下的log

yum配置文件位置

centos的yum配置文件 cat /etc/yum.conf cachedir=/var/cache/yum //yum 缓存的目录,yum 在此存储下载的rpm 包和数据库,默认设置为/var/cache/yumkeepcache=0 //安装完成后是否保留软件包,0为不保留(默认为0),1为保留debuglevel=2 //Debug 信息输出等级,范围为0-10,缺省为2logfile=/var/log/yum.log //yum 日志文件位置.用户可以到/var/log/yum.lo

Linux下常用的配置文件位置

1.别名配置文件 [[email protected] ~]# vim /root/.bashrc     #此处是root用户定义的别名文件的位置,只有root用户登录可用 [[email protected] ~]# vim /lisi/.bashrc     #此处是定义lisi用户的别名配置文件保存位置,只有lisi用户登录可用[[email protected] ~]# vim /etc/bashrc    #此处是定义全局用户的别名配置文件保存位置,所有用户都通用,注意别名定义语句不

3.1.补充:SpringBoot属性赋值,JSR303校验,多环境配置以及配置文件位置

一.YMAL的占位符,松散绑定,实体类装载配置文件信息用于属性赋值 占位符: ${random.int} 松散绑定:Dog.java中的属性名为dogName,YMAL中对应的为dog-name 实体类装载配置文件信息: @ConfigurationProperties(prefix = "dog") 会将配置文件中的dog-name和age赋值给实体类的dogName和age person: name: qinjiang age: ${random.int} #使用占位符设置值 ha

log4j配置文件位置详解

自动加载配置文件: (1)如果采用log4j输出日志,要对log4j加载配置文件的过程有所了解.log4j启动时,默认会寻找source folder下的log4j.xml配置文件,若没有,会寻找log4j.properties文件.然后加载配置.配置文件放置位置正确,不用在程序中手动加载log4j配置文件.如果将配置文件放到了config文件夹下,在build Path中设置下就好了. 若要手动加载配置文件如下: (1)PropertyConfigurator.configure("log4j