Skip to content

Instantly share code, notes, and snippets.

@Qkyrie
Created November 30, 2013 01:47
Show Gist options
  • Save Qkyrie/7714397 to your computer and use it in GitHub Desktop.
Save Qkyrie/7714397 to your computer and use it in GitHub Desktop.
Default Application Config for Spring NO-XML Approach
import com.qkyrie.dom.domtools.Application;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Controller;
/**
* Created with IntelliJ IDEA.
* User: Quinten
* Date: 27-11-13
* Time: 23:54
* To change this template use File | Settings | File Templates.
*/
@Configuration
@ComponentScan(basePackageClasses = Application.class, excludeFilters = @ComponentScan.Filter(Controller.class))
public class ApplicationConfig {
@Bean
public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
ppc.setLocation(new ClassPathResource("/persistence.properties"));
return ppc;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment