• Home
  • About
    • Junseok photo

      Junseok

      개발자 블로그

    • Learn More
    • Facebook
    • Instagram
    • Github
  • Posts
    • All Posts
    • All Tags
  • Java
    • java-basic
    • java-solid
    • java-pattern
    • java-logging
  • Javascript
  • Angular
  • spring
    • spring-framework
    • spring-boot
    • spring-test
  • server
    • jeus
    • webtob
    • tomcat
  • test
    • junit
    • assertj
    • hamcrest
    • dbunit
    • spring
  • docker
  • unix
  • maven
  • db
  • network
  • eclipse
  • intellij
  • microservices
  • etc

PlaceHolder

17 Dec 2018

Reading time ~1 minute

스프링 xml 설정에서 placeholder SPEL로 사용하는 방법

<context:property-placeholder location="classpath:org/uengine/uengine_#{ systemProperties['SYSTYPE']}.properties" />

위 코드 처럼 #{ systemProperties['SYSTYPE']} 스프링 SPEL 을 사용하려면   TOMCAT에서 설정한다.  

톰캣 서버 탭에서 톰캣 서버를 더블클릭한다.

Open launch configuration 을 클릭한다.

아래 창이 뜬다.

-D 옵션으로 SYSTYPE에 값을 주면
#{systemProperties['SYSTYPE']} 으로 읽을 수 있다.

-D 를 붙이는 이유 stackoverflow



springframeworkplaceHolderproperties Share Tweet +1