Question

I have an issue with the Pprod profile. I have created two pages: index.html and profile.html

When I run the project with production profile then the index page is working fine for me. I.e. it converts all CSS, JS and replaces all HTML with the new URL.

If I replace profile.html with index.html then again it is all working fine for me. I.e. it converts all CSS, JS and replaces all HTML with the new URL.

But, if I run both pages simultaneously, then only index.html is working fine for me and profile.html is not.

On profile.html page HTML, the URL is not changed with script.js and main.css file.

Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/styles/postLogin.css

Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/scripts/profile.js

Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/scripts/main.js

Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/scripts/profile/app/app.js

Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/scripts/profile/directive/profile-directive.js

Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/scripts/profile/controller/profile-controller.js

Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/scripts/profile/service/profile-service.js

Any ideas? Thanks in advance.

Was it helpful?

Solution

First you need to upgrade to our latest 0.8.3 version, which I just released 2 minutes ago. It fixes several issues in "production" mode, which probably affect you:

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

Secondly, your main problem is that JHipster is designed to create a "single page" webapp, so obviously if you have two Web pages you will have some minor trouble. The only thing you need to do, AFAIK, is to add your file to the WebConfigurer.initStaticResourcesProductionFilter class, just after the "/index.html" line:

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

That way your file will be served by the "production" filter.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top