hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From syuanji...@apache.org
Subject [10/24] hbase git commit: HBASE-15369 Handle NPE in region.jsp (Samir Ahmic)
Date Mon, 11 Apr 2016 16:10:35 GMT
HBASE-15369 Handle NPE in region.jsp (Samir Ahmic)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3826894f
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3826894f
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3826894f

Branch: refs/heads/hbase-12439
Commit: 3826894f890a850270053a25b53f07a007555711
Parents: c93cffb
Author: tedyu <yuzhihong@gmail.com>
Authored: Wed Apr 6 06:52:51 2016 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Wed Apr 6 06:52:51 2016 -0700

----------------------------------------------------------------------
 .../hbase-webapps/regionserver/region.jsp         | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/3826894f/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp b/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp
index 874ac43..02f3d94 100644
--- a/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp
@@ -21,6 +21,7 @@
   import="java.util.Collection"
   import="java.util.Date"
   import="java.util.List"
+  import="org.owasp.esapi.ESAPI"
   import="static org.apache.commons.lang.StringEscapeUtils.escapeXml"
   import="org.apache.hadoop.conf.Configuration"
   import="org.apache.hadoop.hbase.HTableDescriptor"
@@ -35,10 +36,14 @@
   String regionName = request.getParameter("name");
   HRegionServer rs = (HRegionServer) getServletContext().getAttribute(HRegionServer.REGIONSERVER);
   Configuration conf = rs.getConfiguration();
-
+  String displayName = null;
   Region region = rs.getFromOnlineRegions(regionName);
-  String displayName = HRegionInfo.getRegionNameAsStringForDisplay(region.getRegionInfo(),
+  if(region == null) {
+    displayName= ESAPI.encoder().encodeForHTML(regionName) + " does not exist";
+  } else {
+    displayName = HRegionInfo.getRegionNameAsStringForDisplay(region.getRegionInfo(),
     rs.getConfiguration());
+  }
 %>
 <!--[if IE]>
 <!DOCTYPE html>
@@ -121,7 +126,14 @@
          <p> <%= storeFiles.size() %> StoreFile(s) in set.</p>
          </table>
    <%  }
-   }%>
+   } else { %>
+   <div class="container-fluid content">
+   <div class="row inner_header">
+   </div>
+   <p><hr><p>
+   <p>Go <a href="javascript:history.back()">Back</a>
+   </div>
+  <% } %>
 </div>
 <script src="/static/js/jquery.min.js" type="text/javascript"></script>
 <script src="/static/js/bootstrap.min.js" type="text/javascript"></script>


Mime
View raw message