Java 在会话中使用字符串在jsp页面中换行
我有一个servlet中的doPost-Java 在会话中使用字符串在jsp页面中换行,java,html,jsp,jstl,Java,Html,Jsp,Jstl,我有一个servlet中的doPost- protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.getSession().setAttribute("sysMsg","now we gonna to break line \n"); //
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-
我希望在printLine.jsp中,sysMsg的打印最终会断线。。。为此,在servlet中设置他时,\n将其放在sysMsg的末尾,但这种方法不起作用。请尝试
试试看
<html>
<head>
<title></title>
</head>
<body>
<font size="30" color="Red">${sysMsg} </font>
</body>
</html>
request.getSession().setAttribute("sysMsg","now we gonna to break line <br/>");