Data sly 用于帮助类,它可以是 Java WCMUsePojo 或服务器端 Javascript。
如何在服务器端脚本中使用记录器,例如。data-sly-use.nav="nav.js" ?
HTL comes with a set of global objects that are ready to be used in server side JS. One of these objects is the log
object which exposes an implementation of org.slf4j.Logger
You can use it like the example below in your code:
log.info("some info");
More details can be found in the official documentation which also details out a lot of other helpful objects available in the same context.