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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top