protected boolean isStaticResourceRequest(HttpServletRequest request) { return getStaticFilePath(request) != null; }
/** * Check if this is a request for a static resource and, if it is, serve the * resource to the client. * * @param request * The request * @param response * The response * @return {@code true} if a file was served and the request has been * handled; {@code false} otherwise. * @throws IOException * @throws ServletException * * @since 8.5 */ protected boolean serveStaticResources(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String filePath = getStaticFilePath(request); if (filePath != null) { serveStaticResourcesInVAADIN(filePath, request, response); return true; } return false; }
@Override protected String getStaticFilePath(HttpServletRequest request) { String pathInfo = request.getPathInfo(); if (pathInfo == null) { return null; } if (pathInfo.startsWith(CubaWebJarsHandler.VAADIN_WEBJARS_PATH_PREFIX)) { // handled in CubaWebJarsHandler return null; } String servletPrefixedPath = request.getServletPath() + pathInfo; if (servletPrefixedPath.startsWith(CubaWebJarsHandler.VAADIN_WEBJARS_PATH_PREFIX)) { // handled in CubaWebJarsHandler return null; } return super.getStaticFilePath(request); } }