有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

使用Spring Boot将@WebInitParam中的值外部化

我正在使用Spring引导和GitServlet来创建git http服务器。代码如下

@WebServlet(name = "GitServlet", urlPatterns = {"/git/*"}, loadOnStartup = 1,
        initParams = {
                @WebInitParam(name = "base-path", value = "/var/repos"),
                @WebInitParam(name = "export-all", value = "true")
        })
public class GitServlet extends org.eclipse.jgit.http.server.GitServlet {
}

我想将servlet init参数base-path值(/var/repos)放在Spring配置文件application.yml中,但找不到这样做的方法。 是否有可能将@WebInitParam中的值外部化


共 (0) 个答案