Stream: hapi
Topic: Modifying Thymeleaf templates
Durant Schoon (Sep 01 2020 at 15:00):
Hi,
I have some basic Thymeleaf template questions for a project based on https://github.com/hapifhir/hapi-fhir-jpaserver-starter.
If I wanted to change the value of ${base}
in the following section of code, where would I do that (in Java)?
<td>FHIR Base</td>
<td>
<a th:href="${base}" th:text="${base}"></a>
</td>
And suppose I wanted to override this home.html with my own file, how might I do that?
Thank you!
James Agnew (Sep 01 2020 at 20:50):
The hapi-fhir-testpage-overlay project is a maven overlay project. If you want to customize the files, you put the customized version in your own project as resources in the exact same path as the file you're replacing (generally something like src/main/resources/WEB-INF/templates/home.html
)
The base URL comes from the FHIR server's capability statement, whihc you can customize using a Server Address Strategy in HAPI FHIR server.
Durant Schoon (Sep 04 2020 at 23:04):
I was wondering if there is a java file somewhere with the base
variable defined for substitution, but I probably do want to set a custom Server Address Strategy in my case (displaying a URL other than localhost). Thanks for pointing me in the right direction, James!
Last updated: Apr 12 2022 at 19:14 UTC