Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support New URN in Faces 4.0 Facelets #6069

Closed
hantsy opened this issue Jun 11, 2023 · 3 comments · Fixed by #6160
Closed

Support New URN in Faces 4.0 Facelets #6069

hantsy opened this issue Jun 11, 2023 · 3 comments · Fixed by #6160
Labels
Java EE/Jakarta EE [ci] enable enterprise job kind:feature A feature request

Comments

@hantsy
Copy link

hantsy commented Jun 11, 2023

Description

Faces 4.0 Faceslet use short URN instead of traditional URL, eg.

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="jakarta.faces.facelets"
                xmlns:f="jakarta.faces.core"
                xmlns:h="jakarta.faces.html"
                xmlns:jsf="jakarta.faces">


</ui:composition>

All these URN based tags are not recognized by NetBeans now, there is no completion and validation for the xhtml codes.

Use case/motivation

No response

Related issues

No response

Are you willing to submit a pull request?

No

@hantsy hantsy added kind:feature A feature request needs:triage Requires attention from one of the committers labels Jun 11, 2023
@mbien mbien added Java EE/Jakarta EE [ci] enable enterprise job and removed needs:triage Requires attention from one of the committers labels Jun 11, 2023
@asbachb
Copy link
Collaborator

asbachb commented Jun 17, 2023

More context: jakartaee/faces#1553

asbachb added a commit to asbachb/netbeans that referenced this issue Jun 18, 2023
Since Jakarte EE Faces 4 the xmls namespaces were changed from `http://xmlns.jcp.org/jsf` to `jakarta.*`.
(see jakartaee/faces#1553)

This change adds new namespace support for:
* Generation of new JSF pages
* Tag suggestion in faces xhtml editor view
* Automatical addition of missing namespace decleration when new taglib is used

Reference: apache#6069
@asbachb
Copy link
Collaborator

asbachb commented Jun 18, 2023

I had an initial look into the issue.

I already have a branch which adds the correct namespaces when creating new jsf pages and shows tag suggestions when using Shift + Space.

My concern is that the information for these suggestions are based (at least for maven projects) from a bundles JSF 2.2 taglib jar. Which seems to be used for all jsf versions.
I guess the main problem is that the taglib.xml (which is used to generate the autosuggestions) are not part of the faces-api itself. They seem to be bundled with the implementation. So in order to show any suggestions a implementation needs to be provided somehow - which is a little bit weird as the tags are defined in the faces spec, so I don't see the point not providing them within the faces-api.jar

Currently I don't see an easy option to fetch the taglib matching the used faces version in your project. So we only show JSF 2.2 taglib information and we need to manually map the namespaces somehow based on the used faces version of the project.

/cc @mbien

asbachb added a commit to asbachb/netbeans that referenced this issue Jun 19, 2023
Since Jakarte EE Faces 4 the xmls namespaces were changed from `http://xmlns.jcp.org/jsf` to `jakarta.*`.
(see jakartaee/faces#1553)

This change adds new namespace support for:
* Generation of new JSF pages
* Tag suggestion in faces xhtml editor view
* Automatic addition of missing namespace decleration when new taglib is used

In order to support the JSF 4.0 namespaces the `enum` `JsfVersion` in `web.jsfapi` module
was introduced. It's used to map the taglib namespaces based on the projects detected
JSF version.

Note: There's already an enum `JSFVersion` which is not part of the api. Both enums might
be merged in the future.

Reference: apache#6069
asbachb added a commit to asbachb/netbeans that referenced this issue Jun 19, 2023
Since Jakarte EE Faces 4 the xmls namespaces were changed from `http://xmlns.jcp.org/jsf` to `jakarta.*`.
(see jakartaee/faces#1553)

This change adds new namespace support for:
* Generation of new JSF pages
* Tag suggestion in faces xhtml editor view
* Automatic addition of missing namespace decleration when new taglib is used

In order to support the JSF 4.0 namespaces the `enum` `JsfVersion` in `web.jsfapi` module
was introduced. It's used to map the taglib namespaces based on the projects detected
JSF version.

Note: There's already an enum `JSFVersion` which is not part of the api. Both enums might
be merged in the future.

Reference: apache#6069
asbachb added a commit to asbachb/netbeans that referenced this issue Jun 19, 2023
Since Jakarte EE Faces 4 the xmls namespaces were changed from `http://xmlns.jcp.org/jsf` to `jakarta.*`.
(see jakartaee/faces#1553)

This change adds new namespace support for:
* Generation of new JSF pages
* Tag suggestion in faces xhtml editor view
* Automatic addition of missing namespace declaration when new taglib is used

In order to support the JSF 4.0 namespaces the `enum` `JsfVersion` in `web.jsfapi` module
was introduced. It's used to map the taglib namespaces based on the projects detected
JSF version.

Note: There's already an enum `JSFVersion` which is not part of the api. Both enums might
be merged in the future.

Reference: apache#6069
@asbachb
Copy link
Collaborator

asbachb commented Jul 8, 2023

New PR: #6160

@mbien mbien linked a pull request Jul 8, 2023 that will close this issue
asbachb added a commit to asbachb/netbeans that referenced this issue Jul 12, 2023
Previously NetBeans bundles the JSF reference implementation Mojarra in order to provide several functionality
(like namespaces) based on the parsed taglib xml files from that jar. This is somehow problematic as:
1) The dependency needs to be updated on every new JSF release
2) NetBeans needs to fulfil the expectations of Mojarra

This leads to the problem that we currently cannot update and bundle the latest Mojarra version as
Java 11 is required.

This change wants to get less dependant on that bundled JSF implementation by resolving the reference implementation
using maven. Instead of reading the taglib xml files from that bundled jar NetBeans now gets in from the local maven
repository or downloads it from maven central. If this is not possible we fallback to the bundled version.

This change also improves the situation when autosuggestion is invoked in the namespace part of JSF xhtml documents
by ordering the suggested namespace with the one on top which is most likely to be used.

This should fix apache#6069 apache#5470 apache#5470 apache#4338
asbachb added a commit to asbachb/netbeans that referenced this issue Jul 13, 2023
Previously NetBeans bundles the JSF reference implementation Mojarra in order to provide several functionality
(like namespaces) based on the parsed taglib xml files from that jar. This is somehow problematic as:
1) The dependency needs to be updated on every new JSF release
2) NetBeans needs to fulfil the expectations of Mojarra

This leads to the problem that we currently cannot update and bundle the latest Mojarra version as
Java 11 is required.

This change wants to get less dependant on that bundled JSF implementation by resolving the reference implementation
using maven. Instead of reading the taglib xml files from that bundled jar NetBeans now gets in from the local maven
repository or downloads it from maven central. If this is not possible we fallback to the bundled version.

This change also improves the situation when autosuggestion is invoked in the namespace part of JSF xhtml documents
by ordering the suggested namespace with the one on top which is most likely to be used.

This should fix apache#6069 apache#5470 apache#5470 apache#4338
asbachb added a commit to asbachb/netbeans that referenced this issue Jul 16, 2023
Previously NetBeans bundles the JSF reference implementation Mojarra in order to provide several functionality
(like namespaces) based on the parsed taglib xml files from that jar. This is somehow problematic as:
1) The dependency needs to be updated on every new JSF release
2) NetBeans needs to fulfil the expectations of Mojarra

This leads to the problem that we currently cannot update and bundle the latest Mojarra version as
Java 11 is required.

This change wants to get less dependant on that bundled JSF implementation by resolving the reference implementation
using maven. Instead of reading the taglib xml files from that bundled jar NetBeans now gets in from the local maven
repository or downloads it from maven central. If this is not possible we fallback to the bundled version.

This change also improves the situation when autosuggestion is invoked in the namespace part of JSF xhtml documents
by ordering the suggested namespace with the one on top which is most likely to be used.

This should fix apache#6069 apache#5470 apache#5470 apache#4338
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java EE/Jakarta EE [ci] enable enterprise job kind:feature A feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants