-
-
Notifications
You must be signed in to change notification settings - Fork 172
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
JavaScript validation error when calling a JakartaEE10 MyFaces page #883
Comments
@WolfgangHG many thanks for the issue and the test case. Will have a more detailed look during the next days. But i fear this is similar to #732. Maybe you can simply run your test app and download the http://localhost:8080/test/jakarta.faces.resource/faces.js.jsf file and attach it here. Then i can have a look. |
Just for the records: the file URL is http://localhost:8080/test/jakarta.faces.resource/faces.js.jsf?ln=jakarta.faces#2 - without the parameters, no file is returned. TomEE 10.0M2 bundles "myfaces-api-4.0.2.jar", the same version as in #732 |
And I have set my faces sample to development mode (web.xml parameter "jakarta.faces.PROJECT_STAGE" = "Development"), so it seems to return "faces-development.js" from "myfaces-api-4.0.2.jar" |
@WolfgangHG ah, ok... the the #194 point to the error line - i thing my initial guess is correct the line uses the spread syntax that is currently not supported by Rhino.
For the moment you can only write some Preprocessor the converts the js into something that htmlunit can handle (or ask your boss to sponsor some work to add that to rhino). For writing a preprocessor you can have a look at https://github.com/HtmlUnit/htmlunit/blob/152560e88dac21cd792cc1f716224443ce19cd48/src/main/java/org/htmlunit/javascript/preprocessor/HtmxOneNineTenScriptPreProcessor.java. And reach out to me if you have any questions regarding this. Will have a look at the spread support in rhino again, but this will require some time. |
@WolfgangHG and of course you can also 'patch' the jar itself and replace that not supported constructs (babylon has rhino support) |
Sorry, no chance for a sponsorship ;-) - the issue happens in a small open source project, and it happens only in one tiny unit test that actually uses a Ajax request. And it happens only in the TomEE test suite, while the project mainly focuses on WildFly. So it is also not worth the effort to write a PreProcessor workaround. Hopefully you come up with a fix some time... As the same issue is also tracked by #732, you can close this issue as "duplicate". |
Using HtmlUnitDriver 4.23.0, I observe an ugly EvaluatorException when calling a minimal Jakarta Faces page with just an Ajax call:
Posting the full stacktrace probably does not bring any additional information.
I have a sample to reprocuce, but i requires a few steps:
test.war.zip
mvn clean compile exec:java
- you should see a large exception.htmlunittest.zip
From the log output, I picked this JavaScript file:
test.js.zip
I ran my sample also on WildFly, which includes the Mojarra Jakarta Faces implementation, and here the error did not happen. So maybe it is really a syntax error?
The text was updated successfully, but these errors were encountered: