无法在JHipster on Production上加载另一个页面

问题描述 投票:0回答:1

我对Pprod个人资料有疑问。我创建了两个页面:index.htmlprofile.html

当我使用生产配置文件运行项目时,索引页面对我来说工作正常。即它转换所有CSSJS并用新URL替换所有HTML

如果我用profile.html取代index.html,那么它对我来说一切正常。即它转换所有CSSJS并用新URL替换所有HTML

但是,如果我同时运行两个页面,那么只有index.html工作正常,profile.html不是。

profile.html页面HTML上,使用script.jsmain.css文件不会更改URL。

无法加载资源:服务器响应状态为404(未找到)abc.com/styles/postLogin.css

无法加载资源:服务器响应状态为404(未找到)abc.com/scripts/profile.js

无法加载资源:服务器响应状态为404(未找到)abc.com/scripts/main.js

无法加载资源:服务器响应状态为404(未找到)abc.com/scripts/profile/app/app.js

无法加载资源:服务器响应状态为404(未找到)abc.com/scripts/profile/directive/profile-directive.js

无法加载资源:服务器响应状态为404(未找到)abc.com/scripts/profile/controller/profile-controller.js

无法加载资源:服务器响应状态为404(未找到)abc.com/scripts/profile/service/profile-service.js

有任何想法吗?提前致谢。

gruntjs jhipster
1个回答
1
投票

首先你需要升级到我最新的0.8.3版本,我刚刚在2分钟前发布。它修复了“生产”模式中的几个问题,这可能会对您产生影响:

http://jhipster.github.io/2014/01/29/jhipster-release-0.8.3.html

其次,你的主要问题是JHipster旨在创建一个“单页”webapp,所以很明显,如果你有两个网页,你会遇到一些小麻烦。你唯一需要做的就是将文件添加到WebConfigurer.initStaticResourcesProductionFilter类中,就在“/index.html”行之后:

staticResourcesProductionFilter.addMappingForUrlPatterns(disps, true, "/profile.html");

这样,您的文件将由“生产”过滤器提供。

© www.soinside.com 2019 - 2024. All rights reserved.