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"/>
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.
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
<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 ">
<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 ">