Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-501: Fix admin/analysis.jsp UTF-8 input for some other servlet containers such as Tomcat

Yonik Seeleya11f1fc0b568
diff --git a/CHANGES.txt b/CHANGES.txt
index 1c89f1a2be9..e5633823ea9 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -471,6 +471,9 @@ Bug Fixes
40. SOLR-556: multi-valued fields always highlighted in disparate snippets (Lars Kotthoff via klaas)
+41. SOLR-501: Fix admin/analysis.jsp UTF-8 input for some other servlet
+ containers such as Tomcat. (Hiroaki Kawai, Lars Kotthoff via yonik)
+
Other Changes
1. SOLR-135: Moved common classes to org.apache.solr.common and altered the
build scripts to make two jars: apache-solr-1.3.jar and
diff --git a/src/webapp/web/admin/analysis.jsp b/src/webapp/web/admin/analysis.jsp
index 9dbcd623290..bc9b356f7e5 100644
--- a/src/webapp/web/admin/analysis.jsp
+++ b/src/webapp/web/admin/analysis.jsp
@@ -61,7 +61,7 @@
<h2>Field Analysis</h2>
-<form method="POST" action="analysis.jsp">
+<form method="POST" action="analysis.jsp" accept-charset="UTF-8">
<table>
<tr>
<td>
diff --git a/src/webapp/web/admin/form.jsp b/src/webapp/web/admin/form.jsp
index 88877f7c9e0..def55bd1e8d 100644
--- a/src/webapp/web/admin/form.jsp
+++ b/src/webapp/web/admin/form.jsp
@@ -18,7 +18,7 @@
<%@include file="header.jsp" %>
<br clear="all">
-<form name="queryForm" method="GET" action="../select">
+<form name="queryForm" method="GET" action="../select" accept-charset="UTF-8">
<!-- these are good defaults to have if people bookmark the resulting
URLs, but they should not show up in the form since they are very
output type specific.
diff --git a/src/webapp/web/admin/header.jsp b/src/webapp/web/admin/header.jsp
index 6b615477451..ffd51fd51d1 100644
--- a/src/webapp/web/admin/header.jsp
+++ b/src/webapp/web/admin/header.jsp
@@ -15,13 +15,17 @@
See the License for the specific language governing permissions and
limitations under the License.
--%>
+<html>
+<head>
+<%
+request.setCharacterEncoding("UTF-8");
+%>
<%@include file="_info.jsp" %>
<script>
var host_name="<%= hostname %>"
</script>
-<html>
-<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<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>
diff --git a/src/webapp/web/admin/index.jsp b/src/webapp/web/admin/index.jsp
index 768fd148265..967d0af15f6 100644
--- a/src/webapp/web/admin/index.jsp
+++ b/src/webapp/web/admin/index.jsp
@@ -106,7 +106,7 @@ if (cores.size() > 1) {%><tr><td><strong>Cores:</strong><br></td><td><%
Query String:
</td>
<td colspan=2>
- <form name=queryForm method="GET" action="../select/">
+ <form name=queryForm method="GET" action="../select/" accept-charset="UTF-8">
<textarea class="std" rows="4" cols="40" name="q"><%= defaultSearch %></textarea>
<input name="version" type="hidden" value="2.2">
<input name="start" type="hidden" value="0">