Skip to content

Instantly share code, notes, and snippets.

@kdhrubo
Created April 17, 2017 02:40
package com.hardcode.sample;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import lombok.extern.slf4j.Slf4j;
@Component
@Slf4j
public class SampleTest {
public static String staticStr;
@PostConstruct
public void init() {
log.info("Static string - {}", staticStr);
}
@Value("${static.str:'Hello'}")
public void setstaticStr(String s) {
staticStr = s;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment