AppEngine 与 Eclipse - 共同战争/资源
我一直在使用 Eclipse SDK 3.6.1 创建 Google AppEngine 项目。
在所有项目中,我在 war 文件夹中都有一个 StyleSheet default.css (所有单独的副本)。
我想将此文件保存在一个位置以包含在所有项目中。
我已在工作区文件夹中创建了一个副本。
我尝试将文件链接到 war 文件夹中,它显示为链接文件,我可以编辑它,一切看起来都很好。
当我运行该应用程序时,我可以通过创建的网页看到它无法识别链接的文件。
我希望我错过了一些简单的事情,我不喜欢保留公共资源的多个副本。
有什么想法吗?
谢谢,
雷尼
I have been creating Google AppEngine projects using Eclipse SDK 3.6.1.
In all of the projects I have a StyleSheet default.css (all seperate copies) that I have in the war folder.
I would like to keep this file in one place to be included in all of the projects.
I have created a copy in the workspace folder.
I have tried linking the file into the war folder, it shows up as a linked file, I can edit it, and all looks fine.
When I run the application I can see by the webpage created that it is not recognizing the linked file.
I hope that I am missing something simple, I do not like keeping multiple copies of a common resource.
Any ideas?
Thanks,
RRaney
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
创建一个到该文件的符号链接即可完成这项工作。
例如,在 Windows 7/Vista 计算机上,从 shell(以管理员身份)运行这样的命令来链接两个文件夹:
我假设当您写“我已尝试将文件链接到 war 文件夹”时,您的意思是您尝试使用 Eclipse 的链接文件/文件夹功能将文件/文件夹链接到 war 文件夹中。这些链接仅限于 Eclipse IDE 并由其管理(在 .project 文件中) - Google App Engine 运行时无法识别它们,因为它直接访问文件系统而不是通过 Eclipse。
符号链接是在文件系统级别完成的,Google App Engine 将正确识别并尊重它。
要创建符号链接,请在 Linux 上使用“ln” shell 命令。在 Windows Vista/7 上使用“mklink”(早期的 Windows 版本仅具有“硬链接”,即对于这个目的来说不太好,但也应该完成工作,请参阅“linkd”命令) 。
Creating a symbolic link to the file will do the job.
For example, on a Windows 7/Vista machine, run a command like this from the shell (as an administrator) to link two folders:
I assume that when you wrote "I have tried linking the file into the war folder" you meant that you tried linking a file/folder into the war folder using Eclipse's linked file/folder functionality. These links are limited to the Eclipse IDE and managed by it (int the .project file) - the Google App Engine runtime doesn't recognize them since it accesses the file system directly and not through Eclipse.
A symbolic link is done at the file-system level, and Google App Engine will recognize and respect it properly.
To create a symbolic link, use the "ln" shell command on Linux. On Windows Vista/7 use "mklink" (earlier Windows versions only have "hard links" which are not as nice for this purpose but should also get the job done, see the "linkd" command).
您是否尝试过“静态文件和资源文件”?
Have you tried "Static Files and Resource Files"?