YARN-3589. RM and AH web UI display DOCTYPE wrongly. Contbituted by Rohith.

This commit is contained in:
Tsuyoshi Ozawa 2015-05-08 17:13:40 +09:00
parent fd605997ee
commit f26700f287
3 changed files with 24 additions and 2 deletions

View File

@ -344,6 +344,8 @@ Release 2.8.0 - UNRELEASED
YARN-3592. Fix typos in RMNodeLabelsManager. (Sunil G via devaraj)
YARN-3589. RM and AH web UI display DOCTYPE wrongly. (Rohith via ozawa)
Release 2.7.1 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -78,7 +78,7 @@ public abstract class HtmlPage extends TextView {
@Override
public void render() {
puts(DOCTYPE);
putWithoutEscapeHtml(DOCTYPE);
render(page().html().meta_http("X-UA-Compatible", "IE=8")
.meta_http("Content-type", MimeType.HTML));
if (page().nestLevel() != 0) {

View File

@ -40,7 +40,7 @@ public abstract class TextView extends View {
}
/**
* Print strings as is (no newline, a la php echo).
* Print strings escaping html.
* @param args the strings to print
*/
public void echo(Object... args) {
@ -52,6 +52,17 @@ public abstract class TextView extends View {
}
}
/**
* Print strings as is (no newline, a la php echo).
* @param args the strings to print
*/
public void echoWithoutEscapeHtml(Object... args) {
PrintWriter out = writer();
for (Object s : args) {
out.print(s);
}
}
/**
* Print strings as a line (new line appended at the end, a la C/Tcl puts).
* @param args the strings to print
@ -60,4 +71,13 @@ public abstract class TextView extends View {
echo(args);
writer().println();
}
/**
* Print string as a line. This does not escapes the string for html
* @param args the strings to print
*/
public void putWithoutEscapeHtml(Object args) {
echoWithoutEscapeHtml(args);
writer().println();
}
}