使用 Wicket 进行项目布局
我应该将 .html 文件放在 wicket 应用程序中的什么位置?
我当前的项目布局如下:
src/myproject
--classes+ duplicated html files
web
--numerous .html files - previewed
web/img
--resource files such as css/png/js files
我想避免将 html 文件放在重复的位置。 放置 html 和资源文件的良好非冗余策略是什么? 很明显,这是使用 tomcat,部署时目录结构发生变化
img
WEB-INF
WEB-INF/classes/myproject
,并且 .html 文件和 .class 文件一起保留在顶层 - 这很糟糕。
当然,纯html中的预览功能应该没有相对路径的问题,
有这方面的例子吗? 我的 wicketappllication 类中是否需要特殊代码(例如 IResourceStreamLocator)?
我正在使用 wicket 1.4-rc1。
Where should I put the .html files in a wicket Application?
my current project layout is as follows:
src/myproject
--classes+ duplicated html files
web
--numerous .html files - previewed
web/img
--resource files such as css/png/js files
i want to avoid putting the html files on dupliate locations. what is a good non-redundant strategy to put the html and resource files?
this is using tomcat so obviously, when deployed the directory structure changes to
img
WEB-INF
WEB-INF/classes/myproject
and the .html files stay at the toplevel, as well alongside the .class files - which is bad.
of course, the preview function in plain html should have no problems with relative paths
are there any examples for this? do i need special code (such as a IResourceStreamLocator) in my wicketappllication class?
i am using wicket 1.4-rc1.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我应该吗将 html 和 java 文件放在 Apache Wicket 中的同一个包(文件夹)中?
Should I put html and java files in the same package (folder) in Apache Wicket?
因此,在收集了一些 wicket 的经验后,发现 html 文件的默认位置就可以了。 无需重新发明轮子。
您可以毫无问题地使用相对路径链接资源,并且仍然保留预览功能。
so after gathering some experience with wicket, it turned out that the default location for the html files is just fine. no need to reinvent the wheel.
you can link resources without troubles with relative paths, and still preserve the preview ability.
我建议使用 Maven 来构建您的应用程序。 永远不要依赖 IDE 来构建您的应用程序。 IDE 可能因开发人员而异。 当您想要使用 CI 服务器时,如果您不使用构建系统,则需要回退到脚本编写。
Maven 还将资源与来源分开 。
尽管 Maven 需要一些时间才能进入,但是非常值得付出努力。
I would suggest using Maven to build your application. Never depend on an IDE to build your application. IDE's might differ between developers. When you want to use a CI server you need to fall back to scripting if you don't use a build system.
Maven also separates resources from sources.
Although Maven requires some time to get into it is very much worth the effort.