/** * Creates a {@link JavaScriptUrlReferenceHeaderItem} for the given url. * * @param url * context-relative url of the the javascript resource * @param id * id that will be used to filter duplicate reference (it's still filtered by URL * too) * @param defer * specifies that the execution of a script should be deferred (delayed) until after * the page has been loaded. * @param charset * a non null value specifies the charset attribute of the script tag * @return A newly created {@link JavaScriptUrlReferenceHeaderItem} for the given url. */ public static JavaScriptUrlReferenceHeaderItem forUrl(String url, String id, boolean defer, String charset, String condition) { return new JavaScriptUrlReferenceHeaderItem(url, id, defer, charset, condition); }
/** * Creates a {@link JavaScriptUrlReferenceHeaderItem} for the given url. * * @param url * context-relative url of the the javascript resource * @param id * id that will be used to filter duplicate reference (it's still filtered by URL * too) * @param defer * specifies that the execution of a script should be deferred (delayed) until after * the page has been loaded. * @param charset * a non null value specifies the charset attribute of the script tag * @return A newly created {@link JavaScriptUrlReferenceHeaderItem} for the given url. */ public static JavaScriptUrlReferenceHeaderItem forUrl(String url, String id, boolean defer, String charset, String condition) { return new JavaScriptUrlReferenceHeaderItem(url, id, defer, charset, condition); }
null)); header.render( new JavaScriptUrlReferenceHeaderItem( ResponseUtils.buildURL(base, "/openlayers3/ol.js", null, URLType.RESOURCE), null,
@Override public void renderHead(Component component, IHeaderResponse response) { HttpServletRequest req = getGeoServerApplication().servletRequest(getRequest()); String baseUrl = baseURL(req); response.render( new CssUrlReferenceHeaderItem( buildURL( baseUrl, "openlayers3/ol.css", null, URLMangler.URLType.RESOURCE), null, null)); response.render( new JavaScriptUrlReferenceHeaderItem( buildURL( baseUrl, "openlayers3/ol.js", null, URLMangler.URLType.RESOURCE), null, false, "UTF-8", null)); } });