me hungry!
  • migrate to herdin.github.io
  • DEV TOOLS
    • IDE
      • VSCode
        • spring-boot maven config
  • Spring
    • default
      • IoC
      • resource
      • validation
      • data bind
      • SpringEL
      • DispatcherServlet
    • debug
      • mariadb connection time out - connection pool
  • Database
    • MariaDB
      • command history
  • LINUX
    • CentOS
      • install java
      • install, setting maven
      • install, setting vault
      • upgrade docker to docker-ce
  • WINDOW
    • Road to window docker
  • Arduino
    • default
    • SENSORS
      • dust sensor
        • GP2Y1010AU0F
      • humidity&temperature
        • DHT11
      • lcd
        • SKU DFR0009 - shield
    • debug
Powered by GitBook
On this page

Was this helpful?

  1. Spring
  2. default

resource

PreviousIoCNextvalidation

Last updated 5 years ago

Was this helpful?

java.net.URL 을 추상화 ApplicationContext 의 타입에 따라 Resource 의 구현체가 달라짐.

ApplicationContextType

Resource Implementation

ClassPathXmlApplicationContext

ClassPathResource

FileSystemXmlApplicationContext

FileSystemResource

WebApplicationContext

ServletContextResource

WebApplicationContext All Known Implementing Classes: AbstractRefreshableWebApplicationContext, AnnotationConfigWebApplicationContext, GenericWebApplicationContext, GroovyWebApplicationContext, StaticWebApplicationContext, XmlWebApplicationContext

ApplicationContext Type 에 상관 없이 리소스 구현체를 강제하려면 URL 접두어를 사용

/* using ClassPathResource */
new FileSystemXmlApplicationContext("classpath:com.harm...");
/* using FileUrlResource */
new WebApplicationContext("file://data/web/config/...");

Resource (Spring Framework 6.0.13 API)
Logo