I'm developing a Spring Boot application and I used application.properties to configure db connections ,server port etc..
# ===============================
# = SERVER CONFIGURATION
# ===============================
server.port=8173
# ===============================
# = DATABASE CONFIGURATION
# ===============================
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/springBootApps
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=create
# ===============================
# = SPRING CONFIG
# ===============================
server.error.whitelabel.enabled = false
spring.view.prefix =/WEB-INF/jsp/
spring.view.suffix = .jsp
Can I use an application.properties file instead of spring-configuration.xml or do I need to use both configurations inside my project?
Can I write all my Spring configuration in the application.properties file? (in previous spring versions I did this using springConfiguration file)
As a example how can I implement the following XML configuration in application.properties
<bean id="daoImpl" class="com.mycompany.loginapp.dao.UserDaoImpl"/>
<bean id="data" class="org.springframework.jdbc.core.JdbcTemplate" >
<property name="dataSource" ref="dataSource" />
</bean>