The issue of using eclipse to develop a servlet that uses System.out.println () to print out data in the console

Source: Internet
Author: User
A lot of times when we find out that our servlet is having problems, we subconsciously plug in the SYSTEM.OUT.PRINTLN () to print out the current data, but as you develop the servlet, you'll find that The PRINT statement I just wrote was not printed after the project was executed. You will think, most beginners do not know what the real problem is, go online Baidu, found a lot of things, like what Java files have not been compiled into class, and the location of the servlet to place error problems, But you will find that you have developed under Eclipse and do not need to deploy these, and then you will think whether your own myeclipse have problems, or your own ECLISPE Web plug-in configuration is wrong, in short, the more I think this thing is very serious, however, All of this is a lack of experience for our beginners. In fact, the essence of the problem is not like this, Eclispe really will be automatically compiled for us, but this is a switch, you need to set up your own. This means that it is not your servlet out of the question can not print, but because your server above the servlet is not updated to the latest version of you, the previous version did not print the statement so of course not print AH ~ To solve this problem is very simple, it is necessary in project- > Build automatically click here, so that the front of a "tick" so that will automatically compile, in fact, so, your problem has been resolved, the heart will ask, then why every time in the JSP to make changes, before the setting of automatic compilation Ah, Why does he still show the latest change results? This is because the Java program is deployed in the application server, JSP file first to convert to a servlet file, servlet file is actually a Java file, it will be compiled into a. class file, when the server found that the JSP page changes will be redefined JSP file, so is the latest. And the servlet has been compiled into a class file, you have modified the servlet file, the application server will not be retrieved and recompiled. You need to recompile the modified Java file and replace the previous class file.
Related Article

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.