HBASE-1298 master.jsp & table.jsp do not URI Encode table or region names in links

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@761689 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2009-04-03 14:18:31 +00:00
parent 398b5f20ab
commit e2eacecb29
4 changed files with 13 additions and 7 deletions

View File

@ -70,6 +70,8 @@ Release 0.20.0 - Unreleased
Joffe via Andrew Purtell)
HBASE-1303 Secondary index configuration prevents HBase from starting
(Ken Weiner via Stack)
HBASE-1298 master.jsp & table.jsp do not URI Encode table or region
names in links (Lars George via Stack)
IMPROVEMENTS
HBASE-1089 Add count of regions on filesystem to master UI; add percentage

View File

@ -1,5 +1,6 @@
<%@ page contentType="text/html;charset=UTF-8"
import="java.util.*"
import="java.net.URLEncoder"
import="org.apache.hadoop.io.Text"
import="org.apache.hadoop.hbase.util.Bytes"
import="org.apache.hadoop.hbase.master.HMaster"
@ -54,10 +55,10 @@
if (rootLocation != null) { %>
<table>
<tr><th>Table</th><th>Description</th></tr>
<tr><td><a href=/table.jsp?name=<%= Bytes.toString(HConstants.ROOT_TABLE_NAME) %>><%= Bytes.toString(HConstants.ROOT_TABLE_NAME) %></a></td><td>The -ROOT- table holds references to all .META. regions.</td></tr>
<tr><td><a href=/table.jsp?name=<%= URLEncoder.encode(Bytes.toString(HConstants.ROOT_TABLE_NAME), "UTF-8") %>><%= Bytes.toString(HConstants.ROOT_TABLE_NAME) %></a></td><td>The -ROOT- table holds references to all .META. regions.</td></tr>
<%
if (onlineRegions != null && onlineRegions.size() > 0) { %>
<tr><td><a href=/table.jsp?name=<%= Bytes.toString(HConstants.META_TABLE_NAME) %>><%= Bytes.toString(HConstants.META_TABLE_NAME) %></a></td><td>The .META. table holds references to all User Table regions</td></tr>
<tr><td><a href=/table.jsp?name=<%= URLEncoder.encode(Bytes.toString(HConstants.META_TABLE_NAME), "UTF-8") %>><%= Bytes.toString(HConstants.META_TABLE_NAME) %></a></td><td>The .META. table holds references to all User Table regions</td></tr>
<% } %>
</table>
@ -69,7 +70,7 @@
<table>
<tr><th>Table</th><th>Description</th></tr>
<% for(HTableDescriptor htDesc : tables ) { %>
<tr><td><a href=/table.jsp?name=<%= htDesc.getNameAsString() %>><%= htDesc.getNameAsString() %></a> </td><td><%= htDesc.toString() %></td></tr>
<tr><td><a href=/table.jsp?name=<%= URLEncoder.encode(htDesc.getNameAsString(), "UTF-8") %>><%= htDesc.getNameAsString() %></a> </td><td><%= htDesc.toString() %></td></tr>
<% } %>
<p> <%= tables.length %> table(s) in set.</p>
</table>

View File

@ -1,6 +1,7 @@
<%@ page contentType="text/html;charset=UTF-8"
import="java.util.List"
import="java.util.regex.*"
import="java.net.URLEncoder"
import="org.apache.hadoop.hbase.RegionHistorian"
import="org.apache.hadoop.hbase.master.HMaster"
import="org.apache.hadoop.hbase.RegionHistorian.RegionHistoryInformation"
@ -33,7 +34,7 @@
if (m.matches()) {
// Wrap the region name in an href so user can click on it.
description = RegionHistorian.SPLIT_PREFIX +
"<a href=\"regionhistorian.jsp?regionname=" + m.group(1) + "\">" +
"<a href=\"regionhistorian.jsp?regionname=" + URLEncoder.encode(m.group(1), "UTF-8") + "\">" +
m.group(1) + "</a>";
}

View File

@ -1,4 +1,7 @@
<%@ page contentType="text/html;charset=UTF-8"
import="java.io.IOException"
import="java.util.Map"
import="java.net.URLEncoder"
import="org.apache.hadoop.io.Text"
import="org.apache.hadoop.io.Writable"
import="org.apache.hadoop.hbase.HTableDescriptor"
@ -12,8 +15,6 @@
import="org.apache.hadoop.hbase.master.HMaster"
import="org.apache.hadoop.hbase.master.MetaRegion"
import="org.apache.hadoop.hbase.util.Bytes"
import="java.io.IOException"
import="java.util.Map"
import="org.apache.hadoop.hbase.HConstants"%><%
HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
HBaseConfiguration conf = master.getConfiguration();
@ -131,7 +132,8 @@
hriEntry.getValue()).getInfoPort();
String urlRegionHistorian =
"/regionhistorian.jsp?regionname="+hriEntry.getKey().getRegionNameAsString();
"/regionhistorian.jsp?regionname=" +
URLEncoder.encode(hriEntry.getKey().getRegionNameAsString(), "UTF-8");
String urlRegionServer =
"http://" + hriEntry.getValue().getHostname().toString() + ":" + infoPort + "/";