From c77f7e25c9e349e0ec58cae629d1532ffc19b6ff Mon Sep 17 00:00:00 2001 From: Weiwei Yang Date: Wed, 23 Jan 2019 11:02:15 +0800 Subject: [PATCH] YARN-9210. RM nodes web page can not display node info. Contributed by Jiandan Yang. --- .../hadoop/yarn/server/resourcemanager/webapp/NodesPage.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/NodesPage.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/NodesPage.java index c3a4897ab91..e080f59131b 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/NodesPage.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/NodesPage.java @@ -166,7 +166,7 @@ class NodesPage extends RmView { nodeTableData.append("
") .append(Times.format(info.getLastHealthUpdate())).append("\",\"") - .append(info.getHealthReport()).append("\",\"") + .append(StringEscapeUtils.escapeJava(info.getHealthReport())).append("\",\"") .append(String.valueOf(info.getNumContainers())).append("\",\"") .append("
").append(StringUtils.byteDesc(usedMemory * BYTES_IN_MB)) @@ -201,9 +201,8 @@ class NodesPage extends RmView { nodeTableData.length() - 1); } nodeTableData.append("]"); - String nodeTableDataEscaped = StringEscapeUtils.escapeJava(nodeTableData.toString()); html.script().$type("text/javascript") - ._("var nodeTableData=" + nodeTableDataEscaped)._(); + ._("var nodeTableData=" + nodeTableData)._(); tbody._()._(); } }