I want to know the best practice of configuring Spring XML configuration files
1- how many configuration files should I have ?
2- contents of each file.
Right now, I have 3 xml configuration files for my Spring application, based on some tutorial:
1- app-config.xml: which contains the propertyPlaceholder configuration, and hibernate configuration, and following annotation configuration.
<context:component-scan base-package="com.spring.sample" />
<!-- declares support for general annotations such as @Required, @Autowired, @PostConstruct -->
<context:annotation-config />
<!-- enable the configuration of transactional behavior based on annotations -->
<tx:annotation-driven transaction-manager="transactionManager" />
2- mvc-config.xml: which contains annotation support tag, messageSource configuration, mvc interceptor, and localResolver
3- servlet-config.xml: which contains the viewResolver for jsp, and the following tag:
<context:component-scan base-package="com.spring.sample.controller"/>
see this answer. Spring Configuration
You layout is good, the answer will explain why I use a similar.