Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ContextHolder {
- private static ClassPathXmlApplicationContext context;
- public static getSpringContext() {
- if (context == null) {
- context = new ClassPathXmlApplicationContext("applicationContext.xml");
- }
- return context;
- }
- }
- try (final ClassPathXmlApplicationContext applicationContext =
- new ClassPathXmlApplicationContext("applicationContext.xml")) {
- //do stuff
- }
Add Comment
Please, Sign In to add comment