프레임워크/Spring-Boot

[Spring-Boot]스프링 부트 기본 설정(Property)

benjykim 2018. 8. 9. 20:45
반응형

스프링 부트를 공부하던 중 'application.properties' 파일 요놈 때문에 항상 삽질을 했다.


이번엔 HttpSession을 사용하여 로그인 여부를 mustache 문법을 이용하여 구현했다.

근데 자꾸 로그인 해도 변경이 안되는 것 아닌가. 또 구글링...


이번 기회에 Spring-Boot property 기본 값을 찾아봤다. 

'supawer0728'님의 블로그에서 아래의 내용을 찾을 수 있었다.



# HttpServletRequest의 attribute를 Controller에서 생성한 동일한 이름의 model attribute로 덮어 쓸 수 있는지 여부
spring.mustache.allow-request-override=false

# HttpSession의 attribute를 Controller에서 생성한 동일한 이름의 model attribute로 덮어 쓸 수 있는지 여부
spring.mustache.allow-session-override=false

spring.mustache.cache=false
spring.mustache.charset=UTF-8
spring.mustache.check-template-location=true
spring.mustache.content-type=text/html
spring.mustache.enabled=true

# 모든 request attribute를 template에 병합하기 전 포함시켜야하는 지 여부
spring.mustache.expose-request-attributes=false
# 모든 session attribute를 template에 병합하기 전 포함시켜야하는 지 여부
spring.mustache.expose-session-attributes=false
# RequestContext를 노출할지 여부("springMacroRequsetContext"라는 이름의 spring macro library에 의해 설정됨)
# <link rel="stylesheet" href="{{springMacroRequestContext.request.contextPath}}/assets/app.css">
spring.mustache.expose-spring-macro-helpers=true

spring.mustache.prefix=classpath:/templates/
# 전체 view에서 사용할 RequestContext의 이름(키)
spring.mustache.request-context-attribute=
# viewname의 접미사
spring.mustache.suffix=.mustache
# 처리할 view name의 white list
spring.mustache.view-names=



앞으론 이것을 참고하며 개발해야겠다. 흑흑



반응형