You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by yo...@apache.org on 2006/07/19 20:48:17 UTC
svn commit: r423562 - in /incubator/solr/trunk/src:
java/org/apache/solr/request/ webapp/resources/admin/
webapp/src/org/apache/solr/servlet/
Author: yonik
Date: Wed Jul 19 11:48:16 2006
New Revision: 423562
URL: http://svn.apache.org/viewvc?rev=423562&view=rev
Log:
declare admin-pages to return UTF-8, add space in content-type strings: SOLR-35
Modified:
incubator/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java
incubator/solr/trunk/src/java/org/apache/solr/request/QueryResponseWriter.java
incubator/solr/trunk/src/webapp/resources/admin/_info.jsp (contents, props changed)
incubator/solr/trunk/src/webapp/resources/admin/action.jsp
incubator/solr/trunk/src/webapp/resources/admin/analysis.jsp
incubator/solr/trunk/src/webapp/resources/admin/distributiondump.jsp
incubator/solr/trunk/src/webapp/resources/admin/form.jsp
incubator/solr/trunk/src/webapp/resources/admin/get-file.jsp
incubator/solr/trunk/src/webapp/resources/admin/header.jsp (contents, props changed)
incubator/solr/trunk/src/webapp/resources/admin/index.jsp
incubator/solr/trunk/src/webapp/resources/admin/logging.jsp
incubator/solr/trunk/src/webapp/resources/admin/ping.jsp
incubator/solr/trunk/src/webapp/resources/admin/raw-schema.jsp
incubator/solr/trunk/src/webapp/resources/admin/registry.jsp
incubator/solr/trunk/src/webapp/resources/admin/stats.jsp
incubator/solr/trunk/src/webapp/resources/admin/threaddump.jsp
incubator/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrUpdateServlet.java
Modified: incubator/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java?rev=423562&r1=423561&r2=423562&view=diff
==============================================================================
--- incubator/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java (original)
+++ incubator/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java Wed Jul 19 11:48:16 2006
@@ -18,7 +18,7 @@
*/
public class JSONResponseWriter implements QueryResponseWriter {
- static String CONTENT_TYPE_JSON_UTF8="text/x-json;charset=UTF-8";
+ static String CONTENT_TYPE_JSON_UTF8="text/x-json; charset=UTF-8";
public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException {
Modified: incubator/solr/trunk/src/java/org/apache/solr/request/QueryResponseWriter.java
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/java/org/apache/solr/request/QueryResponseWriter.java?rev=423562&r1=423561&r2=423562&view=diff
==============================================================================
--- incubator/solr/trunk/src/java/org/apache/solr/request/QueryResponseWriter.java (original)
+++ incubator/solr/trunk/src/java/org/apache/solr/request/QueryResponseWriter.java Wed Jul 19 11:48:16 2006
@@ -24,9 +24,9 @@
* @version $Id$
*/
public interface QueryResponseWriter {
- public static String CONTENT_TYPE_XML_UTF8="text/xml;charset=UTF-8";
- public static String CONTENT_TYPE_TEXT_UTF8="text/plain;charset=UTF-8";
- public static String CONTENT_TYPE_TEXT_ASCII="text/plain;charset=US-ASCII";
+ public static String CONTENT_TYPE_XML_UTF8="text/xml; charset=UTF-8";
+ public static String CONTENT_TYPE_TEXT_UTF8="text/plain; charset=UTF-8";
+ public static String CONTENT_TYPE_TEXT_ASCII="text/plain; charset=US-ASCII";
public void write(Writer writer, SolrQueryRequest request, SolrQueryResponse response) throws IOException;
public String getContentType(SolrQueryRequest request, SolrQueryResponse response);
Modified: incubator/solr/trunk/src/webapp/resources/admin/_info.jsp
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/webapp/resources/admin/_info.jsp?rev=423562&r1=423561&r2=423562&view=diff
==============================================================================
--- incubator/solr/trunk/src/webapp/resources/admin/_info.jsp (original)
+++ incubator/solr/trunk/src/webapp/resources/admin/_info.jsp Wed Jul 19 11:48:16 2006
@@ -1,30 +1,31 @@
-<%@ page import="org.apache.solr.core.SolrConfig,
- org.apache.solr.core.SolrCore,
- org.apache.solr.schema.IndexSchema,
- java.io.File"%>
-<%@ page import="java.net.InetAddress"%>
-<%@ page import="org.apache.solr.core.Config"%>
-
-<%
- SolrCore core = SolrCore.getSolrCore();
- int port = request.getServerPort();
- IndexSchema schema = core.getSchema();
-
- // enabled/disabled is purely from the point of a load-balancer
- // and has no effect on local server function. If there is no healthcheck
- // configured, don't put any status on the admin pages.
- String enabledStatus = null;
- String enabledFile = SolrConfig.config.get("admin/healthcheck/text()",null);
- boolean isEnabled = false;
- if (enabledFile!=null) {
- isEnabled = new File(enabledFile).exists();
- }
-
- String collectionName = schema!=null ? schema.getName():"unknown";
- InetAddress addr = InetAddress.getLocalHost();
- String hostname = addr.getCanonicalHostName();
-
- String defaultSearch = SolrConfig.config.get("admin/defaultQuery/text()",null);
- String cwd=System.getProperty("user.dir");
- String solrHome= Config.getInstanceDir();
-%>
+<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
+<%@ page import="org.apache.solr.core.SolrConfig,
+ org.apache.solr.core.SolrCore,
+ org.apache.solr.schema.IndexSchema,
+ java.io.File"%>
+<%@ page import="java.net.InetAddress"%>
+<%@ page import="org.apache.solr.core.Config"%>
+
+<%
+ SolrCore core = SolrCore.getSolrCore();
+ int port = request.getServerPort();
+ IndexSchema schema = core.getSchema();
+
+ // enabled/disabled is purely from the point of a load-balancer
+ // and has no effect on local server function. If there is no healthcheck
+ // configured, don't put any status on the admin pages.
+ String enabledStatus = null;
+ String enabledFile = SolrConfig.config.get("admin/healthcheck/text()",null);
+ boolean isEnabled = false;
+ if (enabledFile!=null) {
+ isEnabled = new File(enabledFile).exists();
+ }
+
+ String collectionName = schema!=null ? schema.getName():"unknown";
+ InetAddress addr = InetAddress.getLocalHost();
+ String hostname = addr.getCanonicalHostName();
+
+ String defaultSearch = SolrConfig.config.get("admin/defaultQuery/text()",null);
+ String cwd=System.getProperty("user.dir");
+ String solrHome= Config.getInstanceDir();
+%>
Propchange: incubator/solr/trunk/src/webapp/resources/admin/_info.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/solr/trunk/src/webapp/resources/admin/action.jsp
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/webapp/resources/admin/action.jsp?rev=423562&r1=423561&r2=423562&view=diff
==============================================================================
--- incubator/solr/trunk/src/webapp/resources/admin/action.jsp (original)
+++ incubator/solr/trunk/src/webapp/resources/admin/action.jsp Wed Jul 19 11:48:16 2006
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%@ page import="org.apache.solr.core.SolrCore,
org.apache.solr.schema.IndexSchema,
java.io.File,
Modified: incubator/solr/trunk/src/webapp/resources/admin/analysis.jsp
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/webapp/resources/admin/analysis.jsp?rev=423562&r1=423561&r2=423562&view=diff
==============================================================================
--- incubator/solr/trunk/src/webapp/resources/admin/analysis.jsp (original)
+++ incubator/solr/trunk/src/webapp/resources/admin/analysis.jsp Wed Jul 19 11:48:16 2006
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%@ page import="org.apache.lucene.analysis.Analyzer,
org.apache.lucene.analysis.Token,
org.apache.lucene.analysis.TokenStream,
Modified: incubator/solr/trunk/src/webapp/resources/admin/distributiondump.jsp
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/webapp/resources/admin/distributiondump.jsp?rev=423562&r1=423561&r2=423562&view=diff
==============================================================================
--- incubator/solr/trunk/src/webapp/resources/admin/distributiondump.jsp (original)
+++ incubator/solr/trunk/src/webapp/resources/admin/distributiondump.jsp Wed Jul 19 11:48:16 2006
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%@ page import="org.apache.solr.core.SolrCore,
org.apache.solr.schema.IndexSchema,
java.io.BufferedReader,
Modified: incubator/solr/trunk/src/webapp/resources/admin/form.jsp
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/webapp/resources/admin/form.jsp?rev=423562&r1=423561&r2=423562&view=diff
==============================================================================
--- incubator/solr/trunk/src/webapp/resources/admin/form.jsp (original)
+++ incubator/solr/trunk/src/webapp/resources/admin/form.jsp Wed Jul 19 11:48:16 2006
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%@include file="header.jsp" %>
<br clear="all">
Modified: incubator/solr/trunk/src/webapp/resources/admin/get-file.jsp
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/webapp/resources/admin/get-file.jsp?rev=423562&r1=423561&r2=423562&view=diff
==============================================================================
--- incubator/solr/trunk/src/webapp/resources/admin/get-file.jsp (original)
+++ incubator/solr/trunk/src/webapp/resources/admin/get-file.jsp Wed Jul 19 11:48:16 2006
@@ -1,10 +1,10 @@
+<%@ page contentType="text/plain; charset=utf-8" pageEncoding="UTF-8"%>
<%@ page import="org.apache.solr.core.Config,
org.apache.solr.core.SolrConfig,
java.io.InputStream,
java.io.InputStreamReader,
java.io.Reader,
java.util.StringTokenizer"%>
-<%@ page contentType="text/plain;charset=UTF-8" language="java" %>
<%
String fname = request.getParameter("file");
String optional = request.getParameter("optional");
Modified: incubator/solr/trunk/src/webapp/resources/admin/header.jsp
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/webapp/resources/admin/header.jsp?rev=423562&r1=423561&r2=423562&view=diff
==============================================================================
--- incubator/solr/trunk/src/webapp/resources/admin/header.jsp (original)
+++ incubator/solr/trunk/src/webapp/resources/admin/header.jsp Wed Jul 19 11:48:16 2006
@@ -1,20 +1,21 @@
-<%@include file="_info.jsp" %>
-<script>
-var host_name="<%= hostname %>"
-</script>
-
-<html>
-<head>
-<link rel="stylesheet" type="text/css" href="solr-admin.css">
-<link rel="icon" href="favicon.ico" type="image/ico"></link>
-<link rel="shortcut icon" href="favicon.ico" type="image/ico"></link>
-<title>Solr admin page</title>
-</head>
-
-<body>
-<a href="."><img border="0" align="right" height="61" width="142" src="solr-head.gif" alt="Solr"></a>
-<h1>Solr Admin (<%= collectionName %>)
-<%= enabledStatus==null ? "" : (isEnabled ? " - Enabled" : " - Disabled") %> </h1>
-
-<%= hostname %>:<%= port %><br/>
-cwd=<%= cwd %> SolrHome=<%= solrHome %>
+<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
+<%@include file="_info.jsp" %>
+<script>
+var host_name="<%= hostname %>"
+</script>
+
+<html>
+<head>
+<link rel="stylesheet" type="text/css" href="solr-admin.css">
+<link rel="icon" href="favicon.ico" type="image/ico"></link>
+<link rel="shortcut icon" href="favicon.ico" type="image/ico"></link>
+<title>Solr admin page</title>
+</head>
+
+<body>
+<a href="."><img border="0" align="right" height="61" width="142" src="solr-head.gif" alt="Solr"></a>
+<h1>Solr Admin (<%= collectionName %>)
+<%= enabledStatus==null ? "" : (isEnabled ? " - Enabled" : " - Disabled") %> </h1>
+
+<%= hostname %>:<%= port %><br/>
+cwd=<%= cwd %> SolrHome=<%= solrHome %>
Propchange: incubator/solr/trunk/src/webapp/resources/admin/header.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/solr/trunk/src/webapp/resources/admin/index.jsp
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/webapp/resources/admin/index.jsp?rev=423562&r1=423561&r2=423562&view=diff
==============================================================================
--- incubator/solr/trunk/src/webapp/resources/admin/index.jsp (original)
+++ incubator/solr/trunk/src/webapp/resources/admin/index.jsp Wed Jul 19 11:48:16 2006
@@ -1,4 +1,4 @@
-
+<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<!-- $Id$ -->
<!-- $Source: /cvs/main/searching/SolrServer/resources/admin/index.jsp,v $ -->
<!-- $Name: $ -->
Modified: incubator/solr/trunk/src/webapp/resources/admin/logging.jsp
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/webapp/resources/admin/logging.jsp?rev=423562&r1=423561&r2=423562&view=diff
==============================================================================
--- incubator/solr/trunk/src/webapp/resources/admin/logging.jsp (original)
+++ incubator/solr/trunk/src/webapp/resources/admin/logging.jsp Wed Jul 19 11:48:16 2006
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%@ page import="org.apache.solr.core.SolrCore,
org.apache.solr.schema.IndexSchema,
java.io.File,
Modified: incubator/solr/trunk/src/webapp/resources/admin/ping.jsp
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/webapp/resources/admin/ping.jsp?rev=423562&r1=423561&r2=423562&view=diff
==============================================================================
--- incubator/solr/trunk/src/webapp/resources/admin/ping.jsp (original)
+++ incubator/solr/trunk/src/webapp/resources/admin/ping.jsp Wed Jul 19 11:48:16 2006
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%@ page import="org.apache.solr.core.SolrConfig,
org.apache.solr.core.SolrCore,
org.apache.solr.core.SolrException"%>
Modified: incubator/solr/trunk/src/webapp/resources/admin/raw-schema.jsp
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/webapp/resources/admin/raw-schema.jsp?rev=423562&r1=423561&r2=423562&view=diff
==============================================================================
--- incubator/solr/trunk/src/webapp/resources/admin/raw-schema.jsp (original)
+++ incubator/solr/trunk/src/webapp/resources/admin/raw-schema.jsp Wed Jul 19 11:48:16 2006
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%@ page import="org.apache.solr.core.SolrCore,
org.apache.solr.schema.IndexSchema"%>
<%@ page import="java.io.InputStreamReader"%>
Modified: incubator/solr/trunk/src/webapp/resources/admin/registry.jsp
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/webapp/resources/admin/registry.jsp?rev=423562&r1=423561&r2=423562&view=diff
==============================================================================
--- incubator/solr/trunk/src/webapp/resources/admin/registry.jsp (original)
+++ incubator/solr/trunk/src/webapp/resources/admin/registry.jsp Wed Jul 19 11:48:16 2006
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%@ page import="org.apache.solr.core.SolrInfoMBean,
org.apache.solr.core.SolrInfoRegistry,
java.net.URL,
Modified: incubator/solr/trunk/src/webapp/resources/admin/stats.jsp
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/webapp/resources/admin/stats.jsp?rev=423562&r1=423561&r2=423562&view=diff
==============================================================================
--- incubator/solr/trunk/src/webapp/resources/admin/stats.jsp (original)
+++ incubator/solr/trunk/src/webapp/resources/admin/stats.jsp Wed Jul 19 11:48:16 2006
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%@ page import="org.apache.solr.core.SolrInfoMBean,
org.apache.solr.core.SolrInfoRegistry,
org.apache.solr.util.NamedList,
Modified: incubator/solr/trunk/src/webapp/resources/admin/threaddump.jsp
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/webapp/resources/admin/threaddump.jsp?rev=423562&r1=423561&r2=423562&view=diff
==============================================================================
--- incubator/solr/trunk/src/webapp/resources/admin/threaddump.jsp (original)
+++ incubator/solr/trunk/src/webapp/resources/admin/threaddump.jsp Wed Jul 19 11:48:16 2006
@@ -1,3 +1,4 @@
+<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%@ page import="java.lang.management.ManagementFactory,
java.lang.management.ThreadMXBean,
java.lang.management.ThreadInfo,
Modified: incubator/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrUpdateServlet.java
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrUpdateServlet.java?rev=423562&r1=423561&r2=423562&view=diff
==============================================================================
--- incubator/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrUpdateServlet.java (original)
+++ incubator/solr/trunk/src/webapp/src/org/apache/solr/servlet/SolrUpdateServlet.java Wed Jul 19 11:48:16 2006
@@ -18,6 +18,7 @@
import org.apache.solr.core.SolrException;
import org.apache.solr.request.XMLResponseWriter;
import org.apache.solr.request.SolrQueryResponse;
+import org.apache.solr.request.QueryResponseWriter;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -35,7 +36,6 @@
public class SolrUpdateServlet extends HttpServlet {
final Logger log = Logger.getLogger(SolrUpdateServlet.class.getName());
private SolrCore core;
- private static String CONTENT_TYPE="text/xml;charset=UTF-8";
XMLResponseWriter xmlResponseWriter;
@@ -47,7 +47,7 @@
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
BufferedReader requestReader = request.getReader();
- response.setContentType(CONTENT_TYPE);
+ response.setContentType(QueryResponseWriter.CONTENT_TYPE_XML_UTF8);
PrintWriter responseWriter = response.getWriter();
core.update(requestReader, responseWriter);
}