相关资料:
《21天学通Java Web开发》
out对象
out对象进行页面输出
1.通过out对象的print()方法和println()方法进行页而输出。
2.不同的println()方法输出完成后,会在字符串后面添加换行标记。
3.println()方法是在JSP编译成Servlet时在字符串后面添加换行标记“
”。如果要实现页面显示的换行,可以使用HTML中的<brt>标签。
OutDemo.jsp

1 <%@ page language="java" contentType="text/html;charset=gb2312" %>
2 <html>
3 <head>
4 <title>使用out对象进行输出</title>
5 </head>
6 <body>
7 <%-- 使用out对象进行输出--%>
8 <%
9 out.print("hello");//不换行
10 out.println("hello");//换行
11 %>
12 </body>
13 </html>