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

Update TagLib URIs for EE10 #172

Merged
merged 2 commits into from
Dec 20, 2021

Conversation

volosied
Copy link
Contributor

@volosied volosied commented Nov 10, 2021

for issue #144

  • I only changed the TLD URIs in some files (those listed under permittedTaglibs.tld which are limited to JSP pages). Once these TLDs are updated, the server container & JSP engine handles the rest based on my understanding & testing.
  • Updated the spec document

TLD docs list the new URIs as so: <%@ taglib prefix="c" uri="jakarta.tags.core" %>

I tested the new implementation on Tomcat 10.0.12, and the new URIs work well. If the old ones were used, then the server encountered the following error:

org.apache.jasper.JasperException: The absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be resolved in either web.xml or the jar files deployed with this application
	org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:54)
	org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:294)
	org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:81)
	org.apache.jasper.compiler.TagLibraryInfoImpl.generateTldResourcePath(TagLibraryInfoImpl.java:251)
	org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:122)
	org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:429

Questions:

Should there be backwards compatibility with the new and old URIs?

JSP Root URI
Should this change? Do we need to wait for the Pages-Api project?
https://github.com/eclipse-ee4j/jstl-api/blob/2a60c5505d3466c49e8f4ab1e49ef42ec0e5e7a3/api/src/main/java/jakarta/servlet/jsp/jstl/tlv/PermittedTaglibsTLV.java#L63

Other TLDs
What should we do with the older TLDs? They use "http://java.sun.com/jstl/" instead of "http://java.sun.com/jsp/jstl/"
https://github.com/eclipse-ee4j/jstl-api/blob/2a60c5505d3466c49e8f4ab1e49ef42ec0e5e7a3/impl/src/main/resources/META-INF/sql-1_0.tld#L27

XPath
Not sure what this is about. Seems safe to change?
https://github.com/eclipse-ee4j/jstl-api/blob/2a60c5505d3466c49e8f4ab1e49ef42ec0e5e7a3/impl/src/main/java/org/apache/taglibs/standard/tag/common/xml/JSTLXPathImpl.java#L188

XPath
Not sure where the http://java.sun.com/jstl/xpath namespace is used or how? Could just be local in this impl?
https://github.com/eclipse-ee4j/jstl-api/blob/2a60c5505d3466c49e8f4ab1e49ef42ec0e5e7a3/impl/src/main/java/org/apache/taglibs/standard/tag/common/xml/JSTLXPathVariableResolver.java#L40-L43

Schema Namespaces for TLDs
Still waiting for new EE 10 schemas: https://jakarta.ee/xml/ns/jakartaee/#10 Only a few are out and they are still drafts.
https://github.com/eclipse-ee4j/jstl-api/blob/2a60c5505d3466c49e8f4ab1e49ef42ec0e5e7a3/impl/src/main/resources/META-INF/c.tld#L20-L23
Using EE9 schemas give me the following error:

[INFO] --- exec-maven-plugin:3.0.0:java (generateTldDoc) @ jakarta.servlet.jsp.jstl ---
Loading and translating 5 Tag Libraries...
com.sun.tlddoc.GeneratorException: Error: /Users/siedlecki/open-source/jstl-api/impl/src/main/resources/META-INF/x.tld does not have xmlns="http://java.sun.com/xml/ns/javaee"
        at com.sun.tlddoc.TLDDocGenerator.createTLDSummaryDoc(TLDDocGenerator.java:555)
        at com.sun.tlddoc.TLDDocGenerator.generate(TLDDocGenerator.java:440)
        at com.sun.tlddoc.TLDDoc.main(TLDDoc.java:217)
        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:254)
        at java.base/java.lang.Thread.run(Thread.java:834)

Should we update the example?
https://github.com/eclipse-ee4j/jstl-api/blame/2a60c5505d3466c49e8f4ab1e49ef42ec0e5e7a3/spec/src/main/asciidoc/jakarta-stl.adoc#L7225-L7255

This should also be updated?
https://github.com/eclipse-ee4j/jstl-api/blob/master/api/src/main/java/jakarta/servlet/jsp/jstl/tlv/package.html

Other URIs that need to be updated? Such as
https://github.com/eclipse-ee4j/jstl-api/blob/2a60c5505d3466c49e8f4ab1e49ef42ec0e5e7a3/impl/src/main/resources/META-INF/permittedTaglibs.tld#L30

@volosied volosied changed the title Update Tag URI for EE10 Update TagLib URIs for EE10 Nov 10, 2021
@volosied
Copy link
Contributor Author

volosied commented Nov 19, 2021

JSP Root URI
I found some references here.

XPath

  • Need to investigate further. Seems like it's just used within the implementation, and it might be safe to change later on.

Schema Namespaces for TLDs

  • This really depends on the TLDDoc. I'll see if there's a way for us to update it and use it within our project.

Examples

  • They should most likely be updated

permittedTaglibs.tld

  • URI is likely fine as is.

Other TLDs

  • I'm not sure what we should do with the older TLDs (version 1.0 and 1.0-rt). I'll will send out an email to the dev list asking if we should remove those. Per the permittedTaglibs.tld, only the following are currently allowed:
      <param-value>
	http://java.sun.com/jsp/jstl/core
	http://java.sun.com/jsp/jstl/fmt
	http://java.sun.com/jsp/jstl/sql
	http://java.sun.com/jsp/jstl/xml
      </param-value>

I don't see why we should keep the older ones if they aren't used (unless a developer overrides them?)

@volosied
Copy link
Contributor Author

  1. Updated the examples.
  2. Per the response in teh JSP-Dev email thread regarding this questions: https://www.eclipse.org/lists/jsp-dev/msg00292.html
  • I'll leave old TLDs alone
  • JSP has no plans to change their URI.
  • XPath can be looked at through another issue.

I think this is ready for review.

Copy link
Contributor

@pnicolucci pnicolucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vlad, I'd like to also see this one added to the changelog in the spec document.

@@ -42,7 +42,7 @@
&lt;display-name&gt;permittedTaglibs&lt;/display-name&gt;
&lt;tlib-version&gt;1.1&lt;/tlib-version&gt;
&lt;short-name&gt;permittedTaglibs&lt;/short-name&gt;
&lt;uri&gt;http://java.sun.com/jstl/permittedTaglibs&lt;/uri&gt;
&lt;uri&gt;http://jakarta.apache.org/taglibs/standard/permittedTaglibs&lt;/uri&gt;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the example to use this URI instead. Taken from the permittedTaglibs.tld : https://github.com/eclipse-ee4j/jstl-api/blob/master/impl/src/main/resources/META-INF/permittedTaglibs.tld#L30

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation= +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job cleaning this up!

@pnicolucci
Copy link
Contributor

pnicolucci commented Dec 14, 2021

The current changes look good. I would like us to do some investigation and have some discussions to determine if we need to or if we should support both for existing applications. Can we do that before we merge this so we know the full scope of this work and can open issues as necessary @volosied ? I'll hold off on approving until we determine what if anything we need to do here in addition to the current PR.

@pnicolucci pnicolucci self-requested a review December 14, 2021 19:04
@volosied
Copy link
Contributor Author

volosied commented Dec 15, 2021

@arjantijms @pnicolucci Before I merge, do you think we should support the old URIs (http://java.sun.com/jsp/jstl/*) or only the new jakarta.tags.*?

Edit: May through a property, at least? TLD is associated with one URI, so we might need to have more TLD files (for EE8 / EE9 cutoff) The property would enable use of the older TLDs (and therefore the older URIs)?

@arjantijms
Copy link
Contributor

Edit: May through a property, at least?

A property would not hurt much. It does bloat the code, but we could deprecate it next version and then remove the version after or so.

The support for these old TLD files could maybe be done in a separate PR?

@volosied
Copy link
Contributor Author

@arjantijms @pnicolucci I think a property is a good idea. I've created #193, and I'll merge this PR for now.

Update Spec Doc & Update package.html
@volosied
Copy link
Contributor Author

Squashed commits. Merging.

@volosied volosied merged commit a3f6454 into jakartaee:master Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants