Beamie
Beamie

Reputation: 725

How Can I Write to response headers with Thymeleaf

I'm just trying out Spring boot, and with that I have simple test JSP-page I'd like to convert to thymeleaf. The JSP has a top page directive that sets a response header. How Can I do the same thing in thymeleaf?

Index.jsp

    <%
        response.setHeader("Content-Security-Policy-Report-Only", "default-src 'self');
    %> 

Upvotes: 0

Views: 2600

Answers (1)

John Thompson
John Thompson

Reputation: 524

The short answer is, you don't. Not in Thymeleaf. Set the response header in the Spring MVC controller.

Upvotes: 2

Related Questions