我在servlet中有doPost
-
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
request.getSession().setAttribute("sysMsg","now we gonna to break line \n");
// forward to printLine.jsp page
dispather.forward(request, response) ;
}
和jsp页面(说,printLine.jsp
) -
<html>
<head>
<title></title>
</head>
<body>
<font size="30" color="Red">${sysMsg} </font>
</body>
</html>
我想在printLine.jsp
中打印sysMsg
最后断行...为了将\n
放在sysMsg
的末尾,当他在servlet中设置时,但这种方式不起作用。
答案 0 :(得分:4)
尝试使用<br/>
request.getSession().setAttribute("sysMsg","now we gonna to break line <br/>");