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

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

Mark Solution

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

해결됨

How to pass hash value from URL to java via sightly?

Avatar

Level 3

Hi,

Can we pass hash value from JS (window.location.hash) to model via HTL code.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 10

I believe when you adapt the Model from SlingHttpServletRequest, it should be available from your request. If not, then you may retrieve it in js/jquery/any other framework/lib and then pass it to server via ajax/form post/hidden param etc. based on your use case.

원본 게시물의 솔루션 보기

4 답변 개

Avatar

정확한 답변 작성자:
Level 10

I believe when you adapt the Model from SlingHttpServletRequest, it should be available from your request. If not, then you may retrieve it in js/jquery/any other framework/lib and then pass it to server via ajax/form post/hidden param etc. based on your use case.

Avatar

Level 10

As Gaurav suggests - try to pass to a Java AEM service using AJAX. TYpically values are passed to HTL Java via component dialogs. However - this value cannot be passed in this manner.

Avatar

Level 10

Or a possible solution here is to build a custom sling resource type - which is based on JavaScript anyhow. THen you can get this value via the custom type and pass as part of the component dialog.

Avatar

Level 10

See this article - where we use a custom color picker as an example - Adobe Experience Manager Help | Creating a custom Experience Manager 6.4 sling:resourceType for Touc...