2

Faced with the issue that NetBeans 8.2 doesn't support new JSF 2.3 tags for example, in the code snippet below:

<f:metadata>
    <f:importConstants type="mypackage.MyClass" />
</f:metadata>

NetBeans highlights f:importConstants with the following error: [The component library Jsf Core doesn't contain component importConstants].

It is fine to live without code completion, but as NB marks code as error - not sure how to set it to ignore such errors.

P.S. Does Eclipse support JSF 2.3? Maybe it is time to switch to Eclipse for a while until NB is fixed.

Thank you!

EDIT-1: this is a Maven Java Web Project in NetBeans, pom.xml has the following entry:

    <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.faces</artifactId>
        <version>2.3.2</version>
        <scope>provided</scope>
    </dependency>
AndrewG10i
  • 661
  • 1
  • 6
  • 21
  • More or less similar issue: https://netbeans.org/bugzilla/show_bug.cgi?id=269440 – AndrewG10i Jul 13 '17 at 09:36
  • Okay, so far Eclipse Oxygen for JavaEE works fine. Doesn't show auto-completion for new JSF 2.3 tags but at least doesn't show errors, what is very nice. Will stay on Eclipse. – AndrewG10i Jul 14 '17 at 00:30

1 Answers1

3

If you need just a couple of tags you can edit the internal Netbeans JSF jar.

Example for supporting to the f:websocket tag:

  • Go to Netbeans folder. The file you need to edit is enterprise/modules/ext/jsf-2_2/javax.faces.jar
  • Download a newer JSF jar and extract it
  • Copy the websocket tag definition from com/sun/faces/metadata/taglib/facelets_jsf_core.taglib.xml into the same file inside the jar provided by Netbeans
  • restart Netbeans

Note 1: if you are thinking to simply download the new jar and put it into a new jsf-2_3 folder or simply replace the whole jar, sorry, it doesn't work.

Note 2: Netbeans is now migrating to Apache Foundation. You can download Netbeans 9 beta version from their repo. I hope it has support for JSF 2.3 tags (I didn't try it).

xonya
  • 2,146
  • 29
  • 37
  • 1
    Thank you! Will try your recommendations soon! – AndrewG10i May 17 '18 at 15:22
  • I have tried your solution but it does not work. Have you been able to get it to work? – Edward Kennedy Aug 15 '18 at 19:37
  • Yes, for me that is working with Netbeans 8.2. Remember to restart the IDE. You have to extract the jar, edit the file and repack it. A jar is a zip archive. – xonya Aug 16 '18 at 09:34
  • 1
    @xonya, amazing! The error has gone. As an aside I spent ages trying to do a jar uf (ie update the jar) and kept getting file does not exist errors (obviously the path to the file to be updated complicates matters) but in the end gave up and tried jar cf instead and that worked first time. Thanks. – JL_SO Aug 27 '18 at 19:18