From: Wolfgang M. M. <wol...@us...> - 2004-08-06 15:30:26
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/http/servlets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17790/src/org/exist/http/servlets Modified Files: XQueryServlet.java Log Message: Applied patch to improve content type handling. Index: XQueryServlet.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/http/servlets/XQueryServlet.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** XQueryServlet.java 21 May 2004 13:35:44 -0000 1.9 --- XQueryServlet.java 6 Aug 2004 15:30:17 -0000 1.10 *************** *** 182,185 **** --- 182,223 ---- return; } + + //------------------------------- + // Added by Igor Abade (ig...@co...) + // Date: Aug/06/2004 + //------------------------------- + + String contentType = this.contentType; + try { + contentType = getServletContext().getMimeType(path); + if (contentType == null) + contentType = this.contentType; + } + catch (Throwable e) { + contentType = this.contentType; + } + finally { + if (contentType.startsWith("text/") || (contentType.endsWith("+xml"))) + contentType += ";charset=" + formEncoding; + response.setContentType(contentType ); + } + + //------------------------------- + + String contentType = this.contentType; + try { + contentType = getServletContext().getMimeType(path); + if (contentType == null) + contentType = this.contentType; + } + catch (Throwable e) { + contentType = this.contentType; + } + finally { + if (contentType.startsWith("text/") || (contentType.endsWith("+xml"))) + contentType += ";charset=" + formEncoding; + response.setContentType(contentType ); + } + String baseURI = request.getRequestURI(); int p = baseURI.lastIndexOf('/'); |