Question

I'm facing a very strange issue with ADF. I add a custom class to a component via StyleClass, I inspect the site, it's there. But when I add its styling to the skin file, like this:

.mycustomclass{   font-size:20px; }

and run again the file, the component doesn't have the custom class that I've set, instead it has "x1ni" and it's going on as x1nk, x1nj, x1u. So for some reason all the classes that are used get renamed in a form like that and of course are ignored by the CSS file. Any class that is not used is ok.

Can anyone explain what's the reason behind this issue and how can I fix it, to keep my custom classes?

Was it helpful?

Solution

Its due to skin css compression/obfuscation. You can disable this behavior by adding parameter to your web.xml

  <context-param>
    <description>Disable obfuscation of CSS rules</description>
    <param-name>org.apache.myfaces.trinidad.DISABLE_CONTENT_COMPRESSION</param-name>
    <param-value>true</param-value>
  </context-param>

Although its recommended only for development cycle, so switch it back to false when you go production.

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