Skip to content

Use ResourceLoader when rendering asset links in thymeleaf error pages #7348

Open
@mvitz

Description

@mvitz

I'm using thymeleaf as template language for our error pages. Unfortunately when rendering links to our assets e.g. @{/css/toolkit.css} the calculated hash which is appended is missing.

The bug can be reproduced using the example application at https://github.com/mvitz/spring-boot-exception-handling by doing these steps:

git clone https://github.com/mvitz/spring-boot-exception-handling
cd spring-boot-exception-handling
mvn spring-boot:run

When visiting localhost:8080/bar the link looks like <link rel="stylesheet" href="/css/toolkit-90b322f81f9983dbd5ee8464f3e8b3db.css" /> on localhost:8080/foo it looks like <link rel="stylesheet" href="/css/toolkit.css" />

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions