External Projects imported by ECLIPSE cannot be identified as web projects and cannot be deployed under tomcat.

Source: Internet
Author: User

1. Go to the project directory, find the. project file, and open it.

2. Find <natures>... </natures>Code, Add the following TAG content and save:

 <Nature  > Org. Eclipse. Jem. workbench. javaemfnature </  Nature  >  
< Nature > Org. Eclipse. WST. Common. modulecore. modulecorenature </ Nature >
< Nature > Org. Eclipse. WST. Common. Project. facet. Core. Nature </ Nature > < Nature > Org. Eclipse. jdt. Core. javanature </ Nature > < Nature > Org. Eclipse. WST. jsdt. Core. jsnature </ Nature >

3. delete the files under. Setting and copy the following files from the. Setting file of other eclipse web projects (if not, create one using eclipse ).

 
. Jsdtscopeorg. eclipse. JST. common. project. facet. core. prefsorg. eclipse. WST. common. componentorg. eclipse. WST. common. project. facet. core. xmlorg. eclipse. WST. jsdt. UI. supertype. containerorg. eclipse. WST. jsdt. UI. supertype. name

4. Modify the project name in org. Eclipse. WST. Common. component.

 <?  XML version = "1.0" encoding = "UTF-8"  ?>  <  Project-Modules  ID  = "Modulecoreid" Project-version  = "1.5.0"  >      <  WB-Module  Deploy-name  = "Springweb"  >          <  WB-Resource  Deploy-Path  = "/"  Source-Path  = "/Webroot"  Tag  = "Defaultrootsource" />          <  WB-Resource  Deploy-Path  = "/WEB-INF/classes"  Source-Path  = "/Src"  />          <  Property  Name  = "Context-root"  Value  = "Springweb"  />          < Property  Name  = "Java-output-path"  Value  = "/Springweb1/build/classes"  />      </  WB-Module  >  </  Project-Modules  > 

Change the place where the preceding deploy-name value is the same to your project name, and change source-path to/webroot (If your project directory is webcontent, you don't need to change it)

 

Then the. jsdtscope file:

 <? XML version = "1.0" encoding = "UTF-8"  ?>  <  Classpath  >      <  Classpathentry  Kind  = "Src"  Path  = "Webroot"  />      <  Classpathentry  Kind  = "Con" Path  = "Org. Eclipse. WST. jsdt. Launching. jre_container"  />      <  Classpathentry  Kind  = "Con"  Path  = "Org. Eclipse. WST. jsdt. Launching. webproject"  >          <  Attributes  >              <  Attribute  Name = "Hide"  Value  = "True"  />          </  Attributes  >      </  Classpathentry  >      <  Classpathentry  Kind  = "Con"  Path  = "Org. Eclipse. WST. jsdt. Launching. basebrowserlibrary" />      <  Classpathentry  Kind  = "Output"  Path  = ""  />  </  Classpath  > 

Change the path in <classpathentry kind = "src" Path = "webroot"/> to/webroot (If your project directory is webcontent, you don't need to change it)

5. Right-click the Eclipse project and refresh the project. You will find that the project has become a web project, and then add it to Tomcat. Tomcat can identify our project.

 

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.