Summary of Several Problems in eclipse Java EE tomcat7.0 Configuration

Source: Internet
Author: User
  1. After jdk1.7 and tomcat7.0 are configured, it is easy to set tomcat in eclipse window --> preference --> server --> runtimeenvironment, but 404 error occurs when Tomcat is started using eclipse. Solution: copy the root folder under the "webapp" installed directory to the "/. metadata /. plugins/org. eclipse. WST. server. the core/tmp0/wtpwebapps directory is overwritten. In this way, you can use eclipse to start

  2. When you use eclipse to add a project to Tomcat, A wtpwebapps will appear in the tomcat installation directory, where Tomcat deploys the servlet. Therefore, if the jar files in the project need to be copied to the Lib folder under this directory. Because both compilation and running must contain these jar packages.
  3. If the Java program in eclipse wants to read the current directory file, it can use a relative path. If the packaged class file is executed, there is no relative path, and the absolute path is required. You can obtain the path of the current. Class file and add the path of your file. The specific method is: (1). Test. Class. getresource (""). The URI Directory of the current filetest. Class file is obtained. Not including yourself
    (2). Test. Class. getresource ("/") returns the absolute URI path of the current classpath.
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.