@Inject
String getGoToFavoritesButtonLink();
在接口中,而不是类。我想将其值修改为getGoToFavoritesButtonLink().concat(".html");
,以便可以将URL外部化。没有任何二传手怎么办?
Java:
@Model(adaptables = org.apache.sling.api.resource.Resource.class, defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
public interface WebshopFavoriteListConfigModel {
@Inject
String
getGoToFavoritesButtonLink();
}
HTML:
<a href="${model.webshopFavoriteListConfigModel.goToFavoritesButtonLink}"/>
答案 0 :(得分:0)
您可以使用extension
HTL选项设置扩展名:
<a href="${model.webshopFavoriteListConfigModel.goToFavoritesButtonLink @ extension='html'}">...</a>