在AEM Classic UI中有一个pathfieldxtype,允许程序员指定一个predicate属性以过滤可选择的页面.
predicate属性的值确定在路径字段中显示哪些页面.有一个数字OOTB的谓词如'hierarchy','folder','hierarchyNotFile'等.
可以通过编写实现org.apache.commons.collections.Predicate该类的OSGi服务来提供自定义谓词.具体而言,通过predicate.name属性的值选择实现.
例如:
@Service(Predicate.class)
@Component(metatype = false)
@Properties(@Property(name = "predicate.name", value = "productPage"))
public class ProductPagePredicate extends com.day.cq.commons.predicate.AbstractNodePredicate {
@Override
public boolean evaluate(Node n) {
// return true or false depending on the state of the node
}
}
Run Code Online (Sandbox Code Playgroud)
可以使用以下方式:
<productPath
jcr:primaryType="cq:Widget"
allowBlank="false"
predicate="[productPage]" <-- refers to the OSGi service
fieldLabel="Product"
name="./productPath"
xtype="pathfield"/>
Run Code Online (Sandbox Code Playgroud)
有没有办法在相当于路径字段的Touch UI中实现类似的自定义级别?
我可以看到小部件granite/ui/components/foundation/form/pathbrowser被许多OOTB组件(foundation/components/image以及其他组件)使用.它看起来像是新接口中路径字段的1:1替换.但是,我在AEM …
此问题与JAX-RS配置有关.
我为单个类配置了JAX-RS.配置工作正常.
@Path(/bean1/)
@Produces("application/xml")
public class class1 {
@POST
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
@Path(/m1)
public String method1(JAXBElement<String> request) {
}
@POST
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
@Path(/m2)
public String method2(JAXBElement<String> request) {
}
}
Run Code Online (Sandbox Code Playgroud)
下面是jaxrs:服务器标签
<jaxrs:server id="bean1" address="/">
<jaxrs:serviceBeans>
<ref bean="class1" />
</jaxrs:serviceBeans>
<jaxrs:extensionMappings>
<entry key="xml" value="application/xml" />
</jaxrs:extensionMappings>
</jaxrs:server>
Run Code Online (Sandbox Code Playgroud)
我可以通过URL"/ bean1/m1"通过Apache Jersey客户端调用
现在,我想用JAX-RS配置另一个类.因此,我添加了如下配置
@Path(/bean2/)
@Produces("application/xml")
public class class2 {
@POST
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
@Path(/m3)
public String method3(JAXBElement<String> request) {
}
}
Run Code Online (Sandbox Code Playgroud)
我添加了另一个jaxrs:服务器标签和指定的地址.有效的配置是
<jaxrs:server id="bean1" address="/bean1">
<jaxrs:serviceBeans>
<ref bean="class1" />
</jaxrs:serviceBeans>
<jaxrs:extensionMappings>
<entry key="xml" value="application/xml" /> …Run Code Online (Sandbox Code Playgroud) 文件结构:
<program>
<projectionDay>
<projection/>
<projection/>
</projectionDay>
<projectionDay>
<projection/>
<projection/>
</projectionDay>
</program>
Run Code Online (Sandbox Code Playgroud)
我想选择第一个和最后一个投影(在整个文档中).
这会返回它:
/descendant::projection[position() = 1 or position() = last()]
Run Code Online (Sandbox Code Playgroud)
这将在projectionDay中返回第一个和最后一个
//projection[position() = 1 or position() = last()]
Run Code Online (Sandbox Code Playgroud)
为什么会这样?
我尝试使用对Plateform-Bom的依赖
<dependency>
<groupId>io.spring.plateform</groupId>
<artifactId>plateform-bom</artifactId>
<version>1.0.1-RELEASE</version>
<type>pom</type>
scope>import</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)
所以我添加了Spring的仓库
<repository>
<id>spring-repo</id>
<name>Spring Maven Repository</name>
<url>https://repo.spring.io/release/</url>
</repository>
Run Code Online (Sandbox Code Playgroud)
但是存储库没有有效的证书,因此maven拒绝使用它。是否有一个http而不是https的存储库,或者您可以在存储库中放置有效的证书吗?最好的祝福
这是mvn命令的结果:
mobo7205@ubuntu:~/NetBeansProjects/plateform/test/test-frontend$ mvn clean install
[INFO] Scanning for projects...
Downloading: https://maven.springframework.org/release/io/spring/plateform/plateform-bom/1.0.1-RELEASE/plateform-bom-1.0.1-RELEASE.pom
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.orange.test:test-frontend:1.0.0-SNAPSHOT (/home/mobo7205/NetBeansProjects/plateform/test/test-frontend/pom.xml) has 2 errors
[ERROR] Non-resolvable import POM: Could not transfer artifact io.spring.plateform:plateform-bom:pom:1.0.1-RELEASE from/to spring-repo (https://maven.springframework.org/release): hostname in certificate didn't match: <maven.springframework.org> != <repo.springsource.org> OR <repo.springsource.org> @ com.orange.test:test:1.0.0-SNAPSHOT, /home/mobo7205/NetBeansProjects/plateform/test/pom.xml, line 111, column 25 -> [Help 2] …Run Code Online (Sandbox Code Playgroud) 如何在Java Web应用程序中获取所有CATALINA_OPTS和/或JAVA_OPTS参数?
我知道我可以读取System.getProperties()以获取所有系统属性.但是,它只显示所有系统属性,包括-D通过的参数CATALINA_OPTS.不喜欢任何参数-Xmx,-Xms等等.
我知道我可以阅读ManagementFactory.getRuntimeMXBean()以获取所有Java参数.但是,这也只显示了-D参数.不喜欢任何参数-Xmx,-Xms等等.
我是新来的。有人可以帮我理解使用< sly data-sly-test =“ $ {condition}” data-sly-unwrap>和< div data-sly-test =“ $ {condition}” data-sly-unwrap之间的区别>
我在AEM html中使用它。使用div标签作为条件语句是否会对结构产生影响?
我正在写一个游戏,当我尝试向服务器发送聊天消息时,我得到一个奇怪的内存泄漏.发送字符串:!chat¥Test变为:
!chat¥test
!chat¥!chat¥test
!chat¥!chat¥!chat¥test
!chat¥!chat¥!chat¥!chat¥test
!chat¥!chat¥!chat¥!chat¥!chat¥test
!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥test
!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥test
!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥test
!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥test
!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥test
!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥test
Ect, ect.
Sending message:
Utils.sendChat(message.getText());
public static void sendChat(String s) {
System.out.println(s);
sendChat("!chat"+Wrapper.commandSplit+s);
}
public static void sendTextLine(String s){
s = s.replace(" ", "[SPACE]");
System.out.println(s);
Wrapper.pw.write(s);
Wrapper.pw.flush();
}
Run Code Online (Sandbox Code Playgroud)
我不知道为什么会这样,有人能帮帮我吗?我使用'¥'来分割字符串中的变量,之前没有给我任何问题,所以我怀疑它与它有什么关系.
谢谢.