Eclipse defaults to webcontent directory modifications to webroot setting instructions __web

Source: Internet
Author: User
In the use of Eclipse, I believe that everyone is more familiar than me (I usually use IntelliJ idea), the following explains how in the Eclipse Web project, how to set the Webroot directory pointing to the problem, I hope to be useful for beginners.

In eclipse3.6, it is the default point of WebRoot for webcontent directory, if our project WebRoot directory is not this name, but Webapp,web and other names? How do I set its point?

L First, Setup when creating a new project:

Next in the New dialog box, change the name of Content Directory to the name you want when you go to Web Module.

L Second, existing project settings, loading an existing Web project, when the project is in eclipse

1, add Web Facets, to the project root node, right button, select Properties, in the pop-up dialog box, select Project Facets, in the Right selection box, check the Java and Dynamic Web Module, and in the dynamic In the post-Web Module number, select the version of the JSP, which defaults to 3.0.

2, or in this interface, select, at this time, select the list below will appear "further Configuration availabe" link, click this link, set src and out path, Next, is the Web Module settings, the first item said, change The content directory name is your WebRoot directory name.

The following two steps are made when eclipse does not automatically make relevant settings for the imported project (that is, there is no. Settings folder under the project root), and if the project is imported, Eclipse automatically chooses Java and Dynamic Web Module, but with The relevant path is incorrect, what should we do?

One way: Delete the. Settings folder under the root of the project, refresh the item (be sure to refresh), and then proceed to the second 1, 2 minor steps. At this point, to increase the web Facets, the original √ will be cleared away, you can reset.

Another way: Change the configuration file, open the Org.eclipse.wst.common.component file under the. Setting folder, open with Notepad,

<wb-module deploy-name= "AMS" >

<wb-resource deploy-path= "/" source-path= "/webcontent"/>

<wb-resource deploy-path= "/web-inf/classes" source-path= "/src"/>

<property name= "Context-root" value= "AMS"/>

<property name= "Java-output-path" value= "/ams/webcontent/web-inf/classes"/>

</wb-module>

If you find the Red logo, change the blue-labeled folder directory to your Webroot directory name. If there is no red logo for this line, you can add it yourself.

While

The. jsdtscope file

<classpathentry kind= "src" path= "webcontent"/> synchronized with the above Source-path consistent

In the Org.eclipse.wst.common.project.facet.core.xml file

<installed facet= "java" version= "1.6"/> This line specifies the JDK version

<installed facet= "Jst.web" version= "2.5"/> This line specifies the Web version, which refers to the servlet and JSP, in addition, if the version of the Web is changed here, pay attention to sync the Web.xml The associated xmlns in;web-app> to the appropriate version

2.3------

<web-app id= "webapp_id" version= "2.3" xmlns= "HTTP://JAVA.SUN.COM/XML/NS/J2EE" xmlns:xsi= /xmlschema-instance "xsi:schemalocation=" Http://java.sun.com/xml/ns/j2ee Http://java.sun.com/xml/ns/j2ee/web-app _2_4.xsd ">

2.4------

<web-app id= "webapp_id" version= "2.4" xmlns= "HTTP://JAVA.SUN.COM/XML/NS/J2EE" xmlns:xsi= /xmlschema-instance "xsi:schemalocation=" Http://java.sun.com/xml/ns/j2ee Http://java.sun.com/xml/ns/j2ee/web-app _2_4.xsd ">

<installed facet= "Wst.jsdt.web" version= "1.0"/> This line specifies the JavaScript version

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.