How to get Turbo lazy load working?

I have /greeting and /messages HTML endpoints working.
They are built with Spring Boot/Thymeleaf.

My /messages endpoint returns:


My /greeting endpoint returns:

    <html xmlns:th="">
        <title>Getting Started: Serving Web Content</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="turbo-cache-control" content="no-cache">
        <script src="" />
    <p th:text="'Hello, ' + ${name} + '!'" />
    <turbo-frame id="messages" src="/messages">
        <p>This message will be replaced by the response from /messages.</p>

when i use chrome to http://localhost:8080/greeting, I get a blank page.
Using developer tools, I see a call to greeting and a call to turbo.js, followed by nothing.
I expect a call to messages, followed by the display of the filled-in page.

What do I need to do to my greeting page to get this to run?

Thank you

Is this the entire response? Because you’ll need to wrap it up in a <turbo-frame> with an id matching what you have on /greeting. That’d look like this:

<turbo-frame id="messages">

OK, I got further by changing my script tag in the head to:

but the replacement value for my turbo frame is not working.
Will reply again once i have it.

yeah, that worked.

For anyone reading this, I had to get the script part right as well as wrap both HTML chunks in turbo-frame tags.