response.sendError(HttpServletResponse.SC_PRECONDITION_FAILED,
"Multiple resources available for the same URL");
return;
}
OEntity pageContentEntity = pageEntities.first().getLink("PageContent", OLink.class).getRelatedEntity();
if (pageContentEntity == null) {
response.sendError(HttpServletResponse.SC_NOT_FOUND, "Not found");
return;
}
String pageContent = pageContentEntity.getProperty("Content", String.class).getValue();
PrintWriter writer = response.getWriter();
writer.print(pageContent);
}