public String getAcceptType() { if (acceptType == null) { acceptType = httpServletRequest.getHeader(HttpConstants.Header.ACCEPT); // try to specify an AcceptType from an registered ContentType suffix String suffix = StringUtils.getFileExtension(getPath()); if (!StringUtils.isNullOrEmpty(suffix)) { ContentTypeEngine engine = contentTypeEngines.getContentTypeEngine(suffix); if (engine != null) { acceptType = engine.getContentType(); } } } return acceptType; }