netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Support Jakarta Standard Tag Library 3.0 URIs in JSPs

Open johny65 opened this issue 7 months ago • 2 comments

Apache NetBeans version

Apache NetBeans 26

What happened

Currently the URIs for Jakarta Standard Tag Library 3.0 (this is from Jakarta EE 10, three years ago) aren't supported and the IDE shows an error when using them in a JSP:

Image

This are the new URIs: https://jakarta.ee/specifications/tags/3.0/jakarta-tags-spec-3.0#multiple-tag-libraries

Language / Project Type / NetBeans Component

JSP

How to reproduce

Create new JSP and add the <%@taglib ... %> sentence with a JSTL 3.0 URI. The IDE shows an error with message "File [relative to JSP file]/jakarta.tags.[tag] not found.".

Did this work correctly in an earlier version?

No

Operating System

Ubuntu 24.10

JDK

OpenJDK Runtime Environment Temurin-23.0.2+7 (build 23.0.2+7)

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

Information on About:

Product Version: Apache NetBeans IDE 26 Java: 23.0.2; OpenJDK 64-Bit Server VM 23.0.2+7 Runtime: OpenJDK Runtime Environment 23.0.2+7 System: Linux version 6.11.0-14-generic running on amd64; UTF-8; es_ES (nb)

Are you willing to submit a pull request?

Yes

johny65 avatar May 28 '25 16:05 johny65

@johny65 please provide a minimal example project.

matthiasblaesing avatar Jun 07 '25 19:06 matthiasblaesing

Just a JSP file is sufficient, but anyway here is a minimal example project:

sample.zip

johny65 avatar Jun 07 '25 22:06 johny65

I had a shot look at this. I experimented with upgrading the bundled JSTL and upgrading the JSP compiler to the most recent Jakarta version. My key takeaways:

  • both the javax version of jstl and the jakarta version can be packaged in the same module
  • Apache Jasper (the JSP compiler) is tied hard to the Servlet API
  • So depending on the project we need to either call the javax version of jasper together with the javax jstl or the corresponding jakarta version
  • the javax.servlet.jsp packages are used through out NetBeans and was considered a stable API. This needs to be abstracted to be able to switch implementations

matthiasblaesing avatar Oct 26 '25 14:10 matthiasblaesing

@johny65 please have a look at #8976. That should take care of parsing jakarta based setups. A test/nightly build is available from the checks page for the next seven days. You can directly download it using this link: https://github.com/apache/netbeans/suites/48954433346/artifacts/4441900731.

I don't often use JSP features, so it would be great if you test this with new and old projects.

matthiasblaesing avatar Nov 02 '25 15:11 matthiasblaesing

Hi @matthiasblaesing, thank you for your work. I'll test it as soon as possible.

johny65 avatar Nov 03 '25 12:11 johny65

It seems it's working fine, good job!

johny65 avatar Nov 06 '25 11:11 johny65

@johny65 thanks of testing! I did another pass, if nothing new comes up, I plan to merge to master in the not to distant future.

matthiasblaesing avatar Nov 07 '25 21:11 matthiasblaesing