1

我有doPost一个 servlet -

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>

我希望在finally break lineprintLine.jsp的打印中sysMsg...对于在 servlet 中设置他时放在\n最后的sysMsg那个,但是这种方式行不通。

4

1 回答 1

4

试试<br/>

request.getSession().setAttribute("sysMsg","now we gonna to break line <br/>");
于 2012-08-09T18:34:59.000 回答