Wednesday, January 06, 2016

CSS loading issue

A Tomcat page, loading from port 8443 using https, had the issue that the first time it loads, all formatting was lost - CSS was not loaded. A page refresh would load the CSS.

My diagnosis was that the relative url to the CSS was being interpreted by the browser as a call to http and not https:8443, and was failing the first time. This turned out to be correct, since giving the full path to the CSS file, like
href=https://servername.com:8443/path/to/file.css
instead of
href=../file.css
(with quotes for the links, of course) solved the problem.

No comments:

Post a Comment