@Override public void init(boolean isServlet, FilterConfig filterConfig) throws ServletException { super.init(isServlet, filterConfig); this.filterConfig = filterConfig; getApplication().getRequestCycleSettings().setRenderStrategy(RenderStrategy.REDIRECT_TO_RENDER); getApplication().getRequestCycleSettings().addResponseFilter(new PortletInvalidMarkupFilter()); //fix for https://github.com/wicketstuff/core/issues/487 getApplication().getMarkupSettings().setMarkupIdGenerator(new PortletMarkupIdGenerator()); //make the wicket bridge schema (HTTPS/HTTP) aware getApplication().setRootRequestMapper(new HttpsMapper(new PortletRequestMapper(getApplication()), new HttpsConfig()){ @Override protected Scheme getDesiredSchemeFor(IRequestHandler handler) { Request request = RequestCycle.get().getRequest(); return super.getSchemeOf(request); } }); //Application must use the portlet specific page renderer provider. getApplication().setPageRendererProvider(PortletPageRenderer::new); // fix for https://github.com/wicketstuff/core/issues/478 issue getApplication().setRequestCycleProvider(context -> new RequestCycle(context) { @Override protected UrlRenderer newUrlRenderer() { return new PortletUrlRenderer(getRequest()); } }); //fix for https://github.com/wicketstuff/core/issues/588 issue getApplication().getJavaScriptLibrarySettings().setWicketAjaxReference(WicketPortletAjaxResourceReference.get()); }