Eclipse defaults to webcontent directory modified to webroot Setup instructions __web

Source: Internet
Author: User
Tags xmlns

Original: http://blog.csdn.net/qbz2004/article/details/7364045 in the use of eclipse, I believe everyone is more than I pro (I usually use Intellij idea), explained below in E Clipse Web project, how to set the Webroot directory to point to the problem, you want to be useful for beginners.

In eclipse3.6, it points to the WebRoot as the WebContent directory, if our project WebRoot directory is not the name, but Webapp,web and other names? How do I set it to point?

L First, settings when creating a new project:

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

L Second, a project has been set up to load an existing Web project when the project is in eclipse

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

2, or in this interface, select, at this time, the selection list will appear under the "Further Configuration availabe" link, click on this link, set the SRC and out path, the next step, is the Web Module settings, the first said, change The content directory name is your WebRoot directory name.

The following two steps are made when eclipse does not automatically set the settings for the imported project (that is, the project root does not have a. Settings folder), and if you import the project, Eclipse automatically selected the Java and Dynamic Web Module, but with The relevant path is not correct, what should we do?

One way: Delete the. Settings folder under the project root, refresh the item (be sure to refresh), and then proceed to the second 1, 2 dot step. At this time, to increase the web Facets, the original √ selection will be cleared off, can be reset.

Another way: Change the configuration file, open the Org.eclipse.wst.common.component file under the. Setting folder, open it 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 folder directory of the blue logo to your Webroot directory name. If you do not have a red label, you can add it yourself.

While

Convert. jsdtscope files

<classpathentry kind= "src" path= "webcontent"/> synchronized to 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, refers to the servlet and JSP, in addition, if the Web version is changed, note that the synchronization of the < in XML The relevant xmlns in;web-app> refers to the corresponding version

2.3------

<web-app id= "webapp_id" version= "2.3" xmlns= "HTTP://JAVA.SUN.COM/XML/NS/J2EE" xmlns:xsi= "http://www.w3.org/2001 /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= "http://www.w3.org/2001 /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.