@Inject
String getGoToFavoritesButtonLink();
is in the interface and not class. I want to modify its value to be something like getGoToFavoritesButtonLink().concat(".html"); so that URL can be externalized. How can this be done without any setter?
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}"/>
You can set the extension using the
extensionHTL option:You can review all URI manipulation options in the HTL Specification.