0

I'm using JSF for the front end of my application. CSS is rendering correctly inside Eclipse but is not working in chrome browser. Here is how I have called the CSS file in JSF. Can anyone tell me what the problem is. Thanks

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"

<h:head>
<title>Login Page</title>
</h:head>
<h:body>
<h:outputStylesheet library="css" name="style.css"  />
kellzer
  • 121
  • 1
  • 3
  • 17

2 Answers2

2

The problem is that Chrome is caching the CSS resources - so only an old stale version is used.

While resource cache control should be configured appropriately for live deployment, one can quickly perform a "force refresh" in Chrome but pressing Ctrl+F5 (or Ctrl+Shift+R) in Windows and Cmd+Shift+R in OS X.

Alternatively, the cache control can be configured from the Chrome Developer tools.

Community
  • 1
  • 1
user2864740
  • 54,112
  • 10
  • 112
  • 187
1

I have this problem from time to time.

Rather than hitting F5, I manually click the refresh, and it usually works. Firefox could also be helpful at that point.

Gadgetster
  • 433
  • 3
  • 10
  • 29