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

Investigate xpath urls #60

Open
volosied opened this issue Nov 24, 2021 · 2 comments
Open

Investigate xpath urls #60

volosied opened this issue Nov 24, 2021 · 2 comments

Comments

@volosied
Copy link
Contributor

This issue was spun off PR jakartaee/tags#172.

We should investigate if any of the following need to change for EE10? Although, I think it's likely safe (and probably best) to leave these as they are.

https://github.com/eclipse-ee4j/jstl-api/blob/2a60c5505d3466c49e8f4ab1e49ef42ec0e5e7a3/impl/src/main/java/org/apache/taglibs/standard/tag/common/xml/JSTLXPathVariableResolver.java#L40-L55

@volosied
Copy link
Contributor Author

I tested various jstl xml tags (using examples found in the source files here), and I didn't find a scenario where these namespaces were used? I tested on Open Liberty using JSTL 2.0.

Per one comment,
https://github.com/eclipse-ee4j/jstl-api/blob/2a60c5505d3466c49e8f4ab1e49ef42ec0e5e7a3/impl/src/main/java/org/apache/taglibs/standard/tag/common/xml/XPathUtil.java#L69

But I didn't see the namespaces used again when I added scopes to the JSTL variables. I'm add a loss here to understand their purpose here.

Namespaces are set here:
https://github.com/eclipse-ee4j/jstl-api/blob/2a60c5505d3466c49e8f4ab1e49ef42ec0e5e7a3/impl/src/main/java/org/apache/taglibs/standard/tag/common/xml/XPathUtil.java#L198-L200

https://github.com/eclipse-ee4j/jstl-api/blob/2a60c5505d3466c49e8f4ab1e49ef42ec0e5e7a3/impl/src/main/java/org/apache/taglibs/standard/tag/common/xml/JSTLXPathVariableResolver.java#L81-L83

Interestingly, I found that QNames were set with the namespaces in the older 1.1.x implementations:

XPathUtil.java

 public Vector getVariableQNames() {
    this.globalVarSize = 0;
    Vector<QName> variableVector = new Vector();
    Enumeration<String> enum_ = this.pageContext.getAttributeNamesInScope(1);
    while (enum_.hasMoreElements()) {
      String varName = enum_.nextElement();
      QName varQName = new QName("http://java.sun.com/jstl/xpath/page", "pageScope", varName);
      variableVector.addElement(varQName);
      this.globalVarSize++;
      variableVector.addElement(new QName(null, varName));
      this.globalVarSize++;
    } 

I think it's probably better to leave this issue alone / close it. These namespaces look to be used internally, so if we do need to update them to jakarta instead of java.sun, we should probably be fine.

@volosied
Copy link
Contributor Author

I don't see any issue with this as is for EE10. We can work on this in at a later date.

@arjantijms arjantijms transferred this issue from jakartaee/tags Feb 7, 2023
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

No branches or pull requests

1 participant