java - 为什么我在检索 sling 的页面属性时收到 "check if the declared type is right and if the method exists"?

标签 java sling

此代码片段应该获取 sling 中的页面属性。

为什么我收到此错误:请检查声明的类型是否正确 以及该方法是否存在。

private String properties;

public void setProperties(String properties){
    this.properties = property;       
    ValueMap property = (ValueMap) properties.getAttribute("properties");
    pageTitle = property.get("pageTitle", "");
}  

最佳答案

properties 的类型为 String,它没有您尝试访问的方法

关于java - 为什么我在检索 sling 的页面属性时收到 "check if the declared type is right and if the method exists"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16798882/

相关文章:

java - Maven Assembly 插件父描述符共享

java - 如何在java中用 "\"替换 "\\"

java - Mockito ArgumentMatchers 不匹配吗?

java - JCR 存储库同步 API

java - 调用 session.getWorkspace().getQuery() 会导致错误

mac osx 中的 Java 7 路径

java - OrientDB慢插入

eclipse - 从AEM下载 bundle 时如何使用Eclipse中的 bundle

java - 解决 Sling OSGi 容器中的依赖项错误

aem - cq5 获取父节点属性