コミュニティアチーブメントバーを展開する。

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

この会話は、活動がないためロックされています。新しい投稿を作成してください。

解決済み

Is there a way to programmatically render a Sling resource?

Avatar

Level 7

Hi,

Apart from rendering Sling resource in response to HTTP requests, is there a way to render them programatically:

protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException { String output = // render "/content/foo/bar/baz.html" response.send(...); }

I am looking for an out-of-the-box solution, otherwise using an HTTP Client library it might be possible to do.

Thanks.

1 受け入れられたソリューション

Avatar

正解者
Employee

You can do this using SlingRequestProcessorService. Please search for this in junit cases in sling. You will find a lot of examples.

元の投稿で解決策を見る

1 返信

Avatar

正解者
Employee

You can do this using SlingRequestProcessorService. Please search for this in junit cases in sling. You will find a lot of examples.