Due to inexperience, a relative path to web design is a problem that has been troubling for half a day.
The first step:
Eclipse creates a new dynamic Web Project, which is conceived as a mayaa+html way to handle the presentation layer of the Web for easy page design.
The directory structure is as follows:
WebContent
+css
+img
-web-inf
-index.html
-index.mayaa
Step Two:
Using Dreamweaver to design HTML pages, the related images and CSS files are relative paths (such as:. /CSS/STYLE.CSS), after the page design is complete, can be displayed in the browser normally, also can preview in Eclipse normal.
Step Three:
Go back to eclipse and do some dynamic processing, then run on server, start Tomcat, run the web.
At this point, the problem arises, Through the Tomcat run index.html cannot find the CSS and image resources, originally thought is the problem of mayaa, the results found that the browser display incorrect page save overwrite index.html, the page can display normally, in order to know, or relative path setting problem.
One idea flashed, since the site root directory is webcontent, then why not try to change the path to css/style.css it, sure enough, so that it can be displayed normally.
However, neither eclipse nor Dreamweaven can be visualized, and the path can only be changed manually.
It was a bit of a hassle, so it was done for the time being.
If the netizen can provide a better solution, welcome message to give advice.