AndrewG10i
AndrewG10i

Reputation: 681

JSF 2.3 support in NetBeans 8.2 (f:importConstants, f:websocket, etc)

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>

Upvotes: 2

Views: 4006

Answers (1)

xonya
xonya

Reputation: 2484

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).

Upvotes: 3

Related Questions