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

"error-on-el-not-found" behavior is not as specified #9537

Closed
opengl-8080 opened this issue Mar 26, 2023 · 5 comments
Closed

"error-on-el-not-found" behavior is not as specified #9537

opengl-8080 opened this issue Mar 26, 2023 · 5 comments
Labels
Bug For general bugs on Jetty side

Comments

@opengl-8080
Copy link

opengl-8080 commented Mar 26, 2023

Jetty version(s)
12.0.0.beta0

Java version/vendor (use: java -version)

$ java --version
openjdk 17.0.5 2022-10-18
OpenJDK Runtime Environment Temurin-17.0.5+8 (build 17.0.5+8)
OpenJDK 64-Bit Server VM Temurin-17.0.5+8 (build 17.0.5+8, mixed mode, sharing)

OS type/version

Windows 10

Description

In the specification of error-on-el-not-found added in Jakarta Server Pages 3.1, it is stated that if both error-on-el-not-found and errorOrELNotFound are not specified, ELResolver returns null.

3.3.4. Unknown EL Identifiers

However, when using Jetty 12.0.0.beta0, PropertyNotFoundException is thrown even if the above condition is met.

The following is a detailed summary of how Jetty behaved depending on the settings, using the reproducible project attached to this issue.

jsp-property-group error-on-el-not-found errorOnELNotFound RESULT
unspecified unspecified unspecified NO ERROR
unspecified unspecified true PropertyNotFoundException
unspecified unspecified false NO ERROR
specified unspecified unspecified PropertyNotFoundException (*)
specified unspecified true PropertyNotFoundException
specified unspecified false NO ERROR
specified true unspecified PropertyNotFoundException
specified true true PropertyNotFoundException
specified true false NO ERROR
specified false unspecified PropertyNotFoundException (*)
specified false true PropertyNotFoundException
specified false false NO ERROR

unspecified in jsp-property-group refers to a state where the jsp-property-group tag does not exist in web.xml. Also, the state where jsp-property-group is specified and error-on-el-not-found is unspecified refers to a state where the jsp-property-group tag exists in web.xml but the error-on-el-not-found tag does not exist. For example, the following state.

    <jsp-config>
        <jsp-property-group>
            <url-pattern>*.jsp</url-pattern>
            <page-encoding>UTF-8</page-encoding>
        </jsp-property-group>
    </jsp-config>

I think that the part with (*) in RESULT is different from the specification.

Also, the results of verifying the same source code by deploying it to Tomcat 10.1.7 are as follows:

jsp-property-group error-on-el-not-found errorOnELNotFound RESULT
unspecified unspecified unspecified NO ERROR
unspecified unspecified true PropertyNotFoundException
unspecified unspecified false NO ERROR
specified unspecified unspecified NO ERROR
specified unspecified true PropertyNotFoundException
specified unspecified false NO ERROR
specified true unspecified PropertyNotFoundException
specified true true PropertyNotFoundException
specified true false NO ERROR
specified false unspecified NO ERROR
specified false true PropertyNotFoundException
specified false false NO ERROR

issue.How to reproduce?

reproduce.zip

I have attached a small Maven project that reproduces the issue.
The initial configuration sets jsp-property-group=specified, error-on-el-not-found=unspecified, and errorOnELNotFound=unspecified.
You can reproduce the issue by launching the application with mvn jetty:run and accessing http://localhost:8080/.
You can verify other patterns by adjusting src/main/webapp/index.jsp and src/main/webapp/WEB-INF/web.xml.

@opengl-8080 opengl-8080 added the Bug For general bugs on Jetty side label Mar 26, 2023
@joakime
Copy link
Contributor

joakime commented Mar 29, 2023

This seems to be entirely within the Apache Jasper implementation.
Still digging.
Wonder if we need a version update of Apache Jasper in Jetty 12?

@janbartel
Copy link
Contributor

jetty-12.0.x for ee10 is currently using Apache Jasper 10.1.5. The latest released version is 10.1.7.

There have only been 2 updates to anything jasper related since 10.1.5, see: https://tomcat.apache.org/tomcat-10.1-doc/changelog.html. Namely issues https://bz.apache.org/bugzilla/show_bug.cgi?id=66419 and https://bz.apache.org/bugzilla/show_bug.cgi?id=66441. @opengl-8080 do either of those sound like they're related to this issue?

@janbartel
Copy link
Contributor

@opengl-8080 thanks for this report: I found the problem. We didn't support parsing the error-on-el-not-found when parsing the jsp-property-group from web.xml. I've raised this PR to fix it: #9625. If you wanted to give it a try to confirm the fix, that would be great.

@opengl-8080
Copy link
Author

I have installed jetty-12.0.x-9537-error-on-el-not-found branch on my local machine and confirmed that the issue has been resolved.
Thank you for addressing this issue!

@janbartel
Copy link
Contributor

Fixed via #9625

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
None yet
Development

No branches or pull requests

3 participants