@Test public void testInvalidPageType() { request.getResource().getValueMap().put("pageType", "something"); request.setQueryString("item=/content/product-page/sub-page"); request.setPathInfo("/mnt/overlay/wcm/core/content/sites/properties.html"); servlet.doGet(request, null); SimpleRenderCondition condition = (SimpleRenderCondition) request.getAttribute(RenderCondition.class.getName()); Assert.assertFalse(condition.check()); }
@Override protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response) { String pageType = request.getResource().getValueMap().get(PAGE_TYPE_PROPERTY, ""); request.setAttribute(RenderCondition.class.getName(), new SimpleRenderCondition(checkPageType(request, pageType))); }
PageTypeRenderConditionServlet extends SlingSafeMethodsServlet { @Override protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response) { String pageType = request.getResource().getValueMap().get(PAGE_TYPE_PROPERTY, ""); request.setAttribute(RenderCondition.class.getName(), new SimpleRenderCondition(checkPageType(request, pageType))); } }
PageTypeRenderConditionServlet extends SlingSafeMethodsServlet { @Override protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response) { String pageType = request.getResource().getValueMap().get(PAGE_TYPE_PROPERTY, ""); request.setAttribute(RenderCondition.class.getName(), new SimpleRenderCondition(checkPageType(request, pageType))); }  }
PageTypeRenderConditionServlet extends SlingSafeMethodsServlet { @Override protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response) { String pageType = request.getResource().getValueMap().get(PAGE_TYPE_PROPERTY, ""); request.setAttribute(RenderCondition.class.getName(), new SimpleRenderCondition(checkPageType(request, pageType))); }   }
PageTypeRenderConditionServlet extends SlingSafeMethodsServlet { @Override protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response) { String pageType = request.getResource().getValueMap().get(PAGE_TYPE_PROPERTY, ""); request.setAttribute(RenderCondition.class.getName(), new SimpleRenderCondition(checkPageType(request, pageType))); }   final static String RESOURCE_TYPE; }