반응형
resourceLoader
-
IoC 컨테이너와 빈(5) - ResourceLoader백기선(인프런 강의)/스프링 프레임워크 핵심 기술 2020. 3. 22. 18:16
@Controller public class HomeController { @Autowired ResourceLoader resourceloader; //ApplicationContext resourceLoader; // 이것도 가능 @RequestMapping(value = "/", method = RequestMethod.GET) public String home(Locale locale, Model model) throws Exception { Resource resource = resourceloader.getResource("classpath:test.txt"); System.out.println(resource.exists()); System.out.println(resource.getFile..