Java 使用Spring Boot将@WebInitParam中的值外部化
我正在使用SpringBoot创建一个GitHTTP服务器。代码如下Java 使用Spring Boot将@WebInitParam中的值外部化,java,spring-boot,jgit,Java,Spring Boot,Jgit,我正在使用SpringBoot创建一个GitHTTP服务器。代码如下 @WebServlet(name=“GitServlet”,urlPatterns={”/git/*”},loadOnStartup=1, initParams={ @WebInitParam(name=“base path”,value=“/var/repos”), @WebInitParam(name=“全部导出”,value=“true”) }) 公共类GitServlet扩展org.eclipse.jgit.http.
@WebServlet(name=“GitServlet”,urlPatterns={”/git/*”},loadOnStartup=1,
initParams={
@WebInitParam(name=“base path”,value=“/var/repos”),
@WebInitParam(name=“全部导出”,value=“true”)
})
公共类GitServlet扩展org.eclipse.jgit.http.server.GitServlet{
}
我想将servlet init参数基本路径
值(/var/repos
)放入Spring配置文件application.yml
,但找不到执行此操作的方法。
是否可以将@WebInitParam
中的值外部化