简体   繁体   English

UrlBuilder for apache sling

[英]UrlBuilder for apache sling

I am looking for Apache Sling Api to build url and links. 我正在寻找Apache Sling Api构建URL和链接。 I have found a URLHandler and LinkUrl but i should install Adobe cq as bundle and this is not what i want. 我已经找到了URLHandler和LinkUrl,但是我应该将Adobe cq作为软件包安装,这不是我想要的。

Can any one recammand an API for URL? 有人可以重新提出URL的API吗? Thanks 谢谢

Depending on what you want to do with the URL, you can maybe have a look at Adobes Templating Language called "HTL" or "Sightly". 根据您要对URL进行的处理,您可以查看Adobe的模板语言“ HTL”或“ Sightly”。 There you can build urls like this. 您可以在此处建立这样的网址。

<a href="${currentPage.path @selectors='mySelector', extension='json'}>...</a>

you can also attach request parameters by generating a map either in a Java class oder JavaScript and then add the @query='myModel.requestParameterMap' 您还可以通过在Java类oder JavaScript中生成映射来附加请求参数,然后添加@query='myModel.requestParameterMap'

I hope this will help you. 我希望这能帮到您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM