Posts

Showing posts with the label Usage of @PostConstruct

Spring Framework and ScheduledExecutorService - Load property files during startup

Hi, I am Malathi Boggavarapu working at Volvo Group and i live in Gothenburg, Sweden. I have been working on Java since several years and had vast experience and knowledge across various technologies. In this post we see how to load property files during the application startup in an efficient way using Spring framework and ExecutorService which allows you to reload properties without server restart if any properties were changed. So let's get started. How to load Property files using Spring Every application is loaded using the deployment descriptor file web.xml. So in web.xml we need to declare the DispatcherServlet class with load-on-startup as 1. servlet-name can be anything. In our example it is called as bl (business layer). So during application startup, server tries to find the bl-servlet.xm l file. web.xml <servlet>     <servlet-name>bl</servlet-name>     <servlet-class>org.springframework,web.servle...