How to use spring expression to read file content and put it into a string?
I would like to do the following.
For example,
@Value(\"classpath
There is a similar question answered here which use Java configuration.
@Configuration
public class Spring {
@Value("classpath:choice-test.html")
private Resource sampleHtml;
@Bean
public String sampleHtmlData() {
try(InputStream is = sampleHtml.getInputStream()) {
return IOUtils.toString(is);
}
}
}