0

I have a line like the following in my .css:

background-image: url(#{resource['gfx/logos.png']}),url(#{resource['gfx/background.png']});

And the above code works perfectly, but NetBeans 4.0 marks lines with #{} code in them as errors. When I am using JSF that allows dynamic css, is there a way I can configure NetBeans to not consider these lines errors? When I do introduce an error it makes it easy for me to be unaware of the error because of these false errors.

4
  • 1
    I don't do Netbeans, but what validation error exactly are you talking about? Usually just Googling the exact error message should give sufficient hints. Also, I wonder if it's an EL or a CSS validation error. If a CSS validation error (because those expressions doesn't look like URLs), how about just enclosing the entire expression in doublequotes like so url("#{resource['gfx/logos.png']}")? Commented Nov 23, 2013 at 10:11
  • Netbeans flags the file as invalid, which means if I ever introduced an actual error I might not notice until runtime. It is a CSS validation error as Netbeans is not aware that there is a situation in which you can embed EL in CSS. Commented Nov 25, 2013 at 14:20
  • Okay. Theoretically, enclosing the EL in doublequotes could possibly fix this false negative. Let me know if it does that, then I'll repost it as an answer. Commented Nov 25, 2013 at 14:22
  • BalusC, if you post you answer below my self answer, I'll delete my answer and accept yours, since I answered myself based on your comment. Commented Nov 25, 2013 at 19:38

1 Answer 1

2

Given the fact that this is actually a CSS validation error which is caused because the url() isn't in the right syntax for an URI, enclosing the entire EL expression in doublequotes should theoretically solve the problem.

Thus, so:

background-image:
    url("#{resource['gfx/logos.png']}"),
    url("#{resource['gfx/background.png']}");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.