Skip to main content
Ce sujet a été fermé aux réponses.
Meilleure réponse par Feike_Visser1

You would have to this via Java/Javascript use-api call.

There you can do something like getResponse().setHeader("a", "b");

3 commentaires

Feike_Visser1
Adobe Employee
Adobe Employee
October 16, 2015

You would have to this via Java/Javascript use-api call.

There you can do something like getResponse().setHeader("a", "b");

Level 2
October 16, 2015

Hi,

I am using a Sling Servlet talking to Solr to get search results. Then the Servlet is using a RequestDispatcher to forward to the page rendering the search results.

I tried to set a Cache-Control header in the Servlet but it does not make it thru when using "forward" on the RequestDispatcher. Therefore I was thinking about adding the header in the Sightly template. Now I have seen that when I use "include" on the RequestDispatcher the request header is set.

Best,

Ronald

smacdonald2008
Level 10
October 16, 2015

What use case you are trying to so with Sighty? If you want to set a header and return data in a HTTP response where you need to set a Header, why not use an AEM Sling Servlet?