GWT:我应该在哪里放置可包含在 .gwt.xml 文件中的外部资源?
我正在使用 GWT 2.4。我想在我的 GWT 模块主页面中包含一些 Javascript 和 CSS 文件。但我在加载它们时遇到了麻烦。在我的 .gwt.xml 文件中,
<!-- Scripts -->
<script src="js/tabber.js"/>
<script src="js/sortable.js"/>
<!-- Stylesheets -->
<stylesheet src="css/example.css" />
<stylesheet src="css/sortable.css" />
“js”和“css”文件夹位于我的“war”目录中,但显然这不是放置它们的正确位置。他们应该去哪里?目录(相对于我的项目的根目录)是
gwt-unitCache
src
test
test-classes
war
I'm using GWT 2.4. I want to include some Javascript and CSS files in my main GWT module page. But I'm having trouble getting them loaded. In my .gwt.xml file I have
<!-- Scripts -->
<script src="js/tabber.js"/>
<script src="js/sortable.js"/>
<!-- Stylesheets -->
<stylesheet src="css/example.css" />
<stylesheet src="css/sortable.css" />
The "js" and "css" folders are located in my "war" directory, but evidently that isn't the right place to put them. Where should they go? The directories (relative to the root of my project) are
gwt-unitCache
src
test
test-classes
war
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我记得,这些路径与 .gwt.xml 文件的位置相关 - 您是否尝试将它们放在那里? (即紧邻该特定模块的 java 包)
更新:
“默认公共路径是存储模块 XML 文件的public 子目录。” - http://code.google.com/webtoolkit/doc/latest/ DevGuideOrganizingProjects.html#DevGuideModules
As far as I remember, these paths are relative to the location of the .gwt.xml file - have you tried placing them there? (i.e. right next to the java packages for that particular module)
Update:
"The default public path is the public subdirectory underneath where the Module XML File is stored." - http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideModules