Difference between system. out. println () in java and out. println () in JSP, system. out. println

Source: Internet
Author: User

Difference between system. out. println () in java and out. println () in JSP, system. out. println

Out. println () is output to the client.   In out. println (), out is a response instance, which outputs a stream with response as the object, that is, the content is outputClient.If System. out. println () is used on the JSP page, only one space is output on the client.System. out. println () is printed on the console. System. out. println () uses the standard output stream, which is output on the console, whereas JSP is not a console program. Whether in JSP or JAVA programs, System. out. println () is printed on the console. If you want to print the content on the page, the simple method is: out. print ("the content to be printed ");In fact, in regular website construction, labels are directly used instead of out. println. Example: Server Platform: tomcat. Client: firefox browser. Source program: // test. jsp file <% @ page contentType = "text/html; charset = gb2312" %> <% @ Page import = "java. util. date "%> <% out. println ("This is printed by out. println. "); System. out. println ("This is printed by System. out. println. "); System. out. println ("This is printed by System. out. println. "); System. out. println ("This is printed by System. out. println. "); out. println ("This is printed by out. println. "); %> </body> 

Why does Systemoutprintln () not work in jsp but outprintln ()

You can use System. out. println () in <% ...... %> ~~~
Are you confused ???
In <%... %>, It is a java fragment,
In jsp
The difference between System. out. println () and out. println () is:
The former is printed on the console, while the latter is output to the client, that is, the page.

In java, systemoutprint and systemoutprintln are different.

System. out. println = system. out. print + system. out. print ("\ n ")
Adds a line feed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.