HTL里面使用sling model的时候传参问题

 Question:

Can we pass in parameters?

${ myClass.fullName }
 
 

Answer:

Only works if class is adaptable from Request

@Model(adaptables = SlingHttpServletRequest.class)

public class HeaderComponent {

@Inject public Page param1; // maps to param1 parameter

@Inject public String param2; // maps to param2 parameter

}

转载于:https://www.cnblogs.com/blogkevin/p/10725747.html

你可能感兴趣的:(HTL里面使用sling model的时候传参问题)