내 커뮤니티 업적 표시줄을 확대합니다.

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

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Component Placeholder i JSP

Avatar

Level 2

Hi guys!

I have a component whose rendering comes from a JSP script. In Sightly I show the component placeholder with this code:

<sly data-sly-test="${wcmmode.edit}">

     <div data-emptytext="Click here to edit this component" class="cq-placeholder"></div>

</sly>

How do I get the same for JSP?

Thanks advance for the help me

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 2

I have solved it. For anyone who comes across the same problem, this is the solution:

<cq:text escapeXml="true" placeholder="<%= Placeholder.getDefaultPlaceholder(slingRequest, "Click here to edit component", null)%>"/>

원본 게시물의 솔루션 보기

5 답변 개

Avatar

Level 10

If you are using HTL - you should keep using it as that is best practice - JSP is no longer considered best practice for AEM development

Avatar

Level 2

Ok, but I'm using JSP for this component, not HTL. Is there a way to do it in JSP?

Thanks for reply

Avatar

정확한 답변 작성자:
Level 2

I have solved it. For anyone who comes across the same problem, this is the solution:

<cq:text escapeXml="true" placeholder="<%= Placeholder.getDefaultPlaceholder(slingRequest, "Click here to edit component", null)%>"/>

Avatar

Level 10

That is great - however the use of JSP is NOT best practice. So ppl following this pattern are following a bad practice. Adobe strongly recommends HTL over JSP!

Avatar

Level 2

I'm learning to use AEM. I wanted to understand how it works. What I'm doing isn't a true webpage.