Java Web Program---the use of the log method of the built-in object application

Source: Internet
Author: User
Tags blank page

In the main method of application, there is log method, which can be used to view information in log file.

When the teacher wrote the code, he found that in the Tomact log directory can not find information, because: we use myeclipse this client software, should be shut down the server, but to the bin directory, manually open the server

That is Startup.bat. This file, and then found the information in the log directory:

Here, I entered the user name, here when the program is running a blank page, only to the log directory can be viewed information.

Code:

login.jsp

?
1 2 3 4 5 6 7 <body>     <form action="yan.jsp">     用户名:<input type="text" name="name"/><br/>     <input type="submit" value="登陆"/>         </form>   </body>

yan.jsp

?
1 2 3 4 5 6 <body>    <%        String str=request.getParameter("name");        application.log("今天的访客是:"+str);            %>

  Here, I entered the user name, here when the program is running a blank page, only to the log directory can be viewed information.

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.