gpt4 book ai didi

Java Web 应用程序。 Spring Boot 。定位图像

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:17:45 24 4
gpt4 key购买 nike

我最近解决了在这个社区中定位图像的问题。你可以看看here .

然而,一个回答说:

Your app is a Spring Boot app. I think that you can also try to use the facilities provided by Spring Boot for serving static content. Anyway, you are doing it right now because you are using webjars for css and js libs!!! Be consistent with the tech that you are using.

这意味着,建议将图像文件放在 /src/main/resources 而不是 /src/main/webapp 中。

我如何使用 Spring Boot 为我提供的便利?

谢谢

最佳答案

Spring Boot 自动配置生产就绪设置,并根据在您的 maven/gradle 构建文件中声明的一些依赖项将 bean 添加到您的 Spring 项目中。只要你遵循约定,那么你就不必做那么多的配置——“约定优于配置”。例如,一种约定是在资源类路径中加载图像和静态文件。请参阅文档:http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/

关于Java Web 应用程序。 Spring Boot 。定位图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32798972/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com