小编use*_*655的帖子

Spring Boot @Value属性

我有一个Spring Boot应用程序,在其中一个类中,我尝试使用application.properties文件引用属性@Value.但是,该财产没有得到解决.我查看了类似的帖子,并尝试按照建议,但这没有帮助.这堂课是:

@Configuration
@ComponentScan
@EnableAutoConfiguration
public class PrintProperty {

  @Value("${file.directory}")
  private String fileDirectory;

  public void print() {
    System.out.println(fileDirectory);
  }
}
Run Code Online (Sandbox Code Playgroud)

我有属性file.directory application.properties.我也有其他领域.

spring spring-annotations spring-boot

30
推荐指数
4
解决办法
10万
查看次数

使用Apache Camel发送POST请求

我能够使用Apache Camel将GET请求发送到REST服务,现在我正尝试使用Apache Camel发送具有JSON正文的POST请求。我无法弄清楚如何添加JSON正文和发送请求。如何添加JSON正文,发送请求并获取响应代码?

java rest post apache-camel camel-http

6
推荐指数
2
解决办法
1万
查看次数