我陷入了基本的JSP操作。我想要一條新線路,所以我在最後添加了\ n,但它引發了一個例外。如果我刪除\ n一切正常JSP:在response.setHeader中傳遞特殊字符?
異常
java.lang.IllegalArgumentException: Invalid LF not followed by whitespace
類文件
StringBuilder junitLog = new StringBuilder();
junitLog.append("The class that is being executed : " + description.getClassName() +"\n");
junitLog.append("Number of testcases to execute : " + description.testCount()+"\n");
/**
* @return the junitLog
*/
public StringBuilder getJunitLog() {
return junitLog;
}
/**
* @param junitLog the junitLog to set
*/
public void setJunitLog(StringBuilder junitLog) {
this.junitLog = junitLog;
}
JSP: -
response.setHeader("finalJUNITReport",""+ junitListener.getJunitLog());