How to change default Eclipse WTP “Web Resources” dynamic folder

核能气质少年 提交于 2019-12-29 18:43:40

问题


I need to change the default Eclipse WTP "Web Resources" dynamic folder. Currently it points to WebContent, and I need to point to src\main\webapp.


回答1:


I found the solution: Under .settings folder in your project's folder, there is a file named "org.eclipse.wst.common.component", inside it change the line <wb-resource deploy-path="/" source-path="/WebContent"/> with <wb-resource deploy-path="/" source-path="/src/main/webapp"/>.

That's all!




回答2:


I prefer the following solution, as the configuration is then saved in the .project file and also all files are kept visible in the Eclipse Project Explorer.

Create a Linked Folder called WebContent pointing to /src/main/webapp:

Right click project > New > Folder. Folder name: WebContent. Advanced > Link to alternate location (Linked Folder): PROJECT_LOC/src/main/webapp.




回答3:


Give Preference to eclipse GUI!

if don't appear to you see this

Unable to find Deployment assembly Eclipse Juno




回答4:


  1. Disable "Dynamic Web Module" project nature, click "Apply" button
  2. Enable previous option checkbox, notice "Feather configuration available..." at the bottom.
  3. Click "Feather configuration available..." link and change directory
  4. Click "Apply" button



回答5:


Or you may even do a simple rename of WebContent directory. Eclipse will update the above mention settings files




回答6:


In my case the problem was that the jsp located in resources/templates were not found

The solution has been to change

<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>

by the following

<wb-resource deploy-path="/" source-path="/src/main/resources"/>

That is, modifying the file

.settings\org.eclipse.wst.common.component


来源:https://stackoverflow.com/questions/3422746/how-to-change-default-eclipse-wtp-web-resources-dynamic-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!