我现在明白了木兰是如何运作的。我用Java为Magnolia内容应用程序编写REST端点。我的内容应用程序是类别-应用程序,它看起来如下:
- cat-1: cat-1, cat-4;
- cat-3: ""我的任务是在Java中为类别应用程序定义REST端点,它根据传递的类别名称传递子类别,并在组件中显示它们。例如:如果输入"GET "cat-1",则得到JSON-Array“cat-1”,"cat-4“
我想把java代码和我的端点连接起来。我已经创建了‘test终结点’端点,但是在将我的java代码与浏览器中的get请求结合起来时遇到了问题。http://localhost:8080/.rest/testendpoint/20
Java-代码:
@Api("/testendpoint")
@Path("/testendpoint")
class EndpointService {
@GET
@Path("/testendpoint/{endpointId}")
@Produces(MediaType.APPLICATION_JSON)
public String getResponse( @QueryParam("endpointId") String endpointId) throws JsonProcessingException {
JsonObject json = new JsonObject();
json.addProperty("Mobile", endpointId);
json.addProperty("Name", "Fake name");
return json.toString();
}
}在存储库“src/main/resources/rest-端点”中,我有yaml-文件:
class: info.magnolia.rest.service.node.definition.ConfiguredNodeEndpointDefinition
implementationClass: com.raysono.endpoints.EndpointService也许我忘了联系别的东西了。请帮助检查和自定义请求

https://stackoverflow.com/questions/73940187
复制相似问题