如何更改默认的 Eclipse WTP“Web 资源”动态文件夹
我需要更改默认的 Eclipse WTP“Web Resources”动态文件夹。目前它指向WebContent,而我需要指向src\main\webapp。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我找到了解决方案:
在项目文件夹中的 .settings 文件夹下,有一个名为“org.eclipse.wst.common.component”的文件,在其中更改行
与
。就这样!
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!
优先考虑 eclipse GUI!
如果您没有看到此
无法找到部署程序集 Eclipse Juno
Give Preference to eclipse GUI!
if don't appear to you see this
Unable to find Deployment assembly Eclipse Juno
我更喜欢以下解决方案,因为配置随后保存在
.project
文件中,并且所有文件在 Eclipse Project Explorer 中都保持可见。创建一个名为
WebContent
的链接文件夹,指向/src/main/webapp
:右键单击项目 >新的>文件夹。文件夹名称:
WebContent
。高级>链接到备用位置(链接文件夹):PROJECT_LOC/src/main/webapp
。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
.或者您甚至可以对 WebContent 目录进行简单的重命名。 Eclipse 将更新上述设置文件
Or you may even do a simple rename of WebContent directory. Eclipse will update the above mention settings files
就我而言,问题是找不到位于资源/模板中的jsp
进行更改
解决方案是通过以下方式
即修改文件
In my case the problem was that the jsp located in resources/templates were not found
The solution has been to change
by the following
That is, modifying the file