azev
V2EX  ›  问与答

SpringBoot 中用了 thymeleaf 模板,有没有办法动态在某节点插入一个 html 文件。

  •  
  •   azev · Jun 11, 2020 · 1776 views
    This topic created in 2200 days ago, the information mentioned may be changed or developed.

    这些 html 文件是运行期间从合作方拿回来的。
    看了下 fragment,貌似是插入打包好的文件?

    5 replies    2020-06-11 19:06:31 +08:00
    randyo
        1
    randyo  
       Jun 11, 2020 via Android
    用 iframe 试试
    glaucus
        2
    glaucus  
       Jun 11, 2020
    th:replace?
    snowydec
        3
    snowydec  
       Jun 11, 2020
    这种事情不是应该交给 js 做么
    azev
        4
    azev  
    OP
       Jun 11, 2020
    @randyo
    @glaucus
    多谢回复 想了下
    我这系统是一个 SpringBoot 打包好的 jar 文件 现在是要访问这些运行期取回保存的文件
    核心问题貌似就是文件 url 与路径的问题
    看来在 nginx 里配置一下应该就可以


    @snowydec 有道理 ajax 动态载入也可行
    randyo
        5
    randyo  
       Jun 11, 2020 via Android
    第三方提供的 html 不敢信任,还是 iframe 安全点
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2679 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 13:45 · PVG 21:45 · LAX 06:45 · JFK 09:45
    ♥ Do have faith in what you're doing.