-
1. Re: Java EE 7 + EL 3.0 + Wildfly 10 - returns empty string on constant
ctomc Aug 9, 2016 1:00 PM (in response to arthurborsboom)how does your deployment look like?
what jars do you have in your WEB-INF/lib?
-
2. Re: Java EE 7 + EL 3.0 + Wildfly 10 - returns empty string on constant
arthurborsboom Aug 9, 2016 2:14 PM (in response to ctomc)The project is an empty Web project created by Eclipse and has the following structure.
├── build
│ └── classes
├── src
└── WebContent
├── index.jsp
├── META-INF
│ └── MANIFEST.MF
└── WEB-INF
├── lib
└── web.xml
The WEB-INF/lib folder is empty.
The index.jsp contains the code in the initial post.
The web.xml contains the following.
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>helloworld</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
-
3. Re: Java EE 7 + EL 3.0 + Wildfly 10 - returns empty string on constant
jaikiran Aug 10, 2016 5:42 AM (in response to arthurborsboom)This looks like a bug. I've created a JIRA [WFLY-6939] Usage of static fields from java.lang classes as EL expressions in JSPs doesn't work - JBoss Issue Tracker and submitted a PR for review [10.x branch] Fix for WFLY-6939 by jaikiran · Pull Request #9114 · wildfly/wildfly · GitHub. If it gets approved then the fix might make it to the upcoming 10.1.0.Final release of WildFly.
-
4. Re: Java EE 7 + EL 3.0 + Wildfly 10 - returns empty string on constant
arthurborsboom Aug 10, 2016 10:22 AM (in response to jaikiran)I have seen you have created a patch for the issue to make sure that static fields of java.lang.* can be resolved, which is indeed the reported issue.
Does this patch also cover static fields which are imported in the JSP page (which is what I am trying to achieve)?
For example:
<%@ page import="com.example.YourConstants" %>
${YourConstants.FOO}
-
5. Re: Java EE 7 + EL 3.0 + Wildfly 10 - returns empty string on constant
jaikiran Aug 11, 2016 9:59 AM (in response to arthurborsboom)Arthur Borsboom wrote:
I have seen you have created a patch for the issue to make sure that static fields of java.lang.* can be resolved, which is indeed the reported issue.
Does this patch also cover static fields which are imported in the JSP page (which is what I am trying to achieve)?
For example:
<%@ page import="com.example.YourConstants" %>
${YourConstants.FOO}
I hadn't realized even that resolution was failing. I've updated the PR to (try and) handle that and included the test case for it. With that PR, it now works fine for java.lang.* package but there appears to be another different issue [WFLY-6943] javax.el.ImportHandler#resolveClass API doesn't use "current" classloader - JBoss Issue Tracker that causes the usage of application specific classes in EL expressions, like the one above, to fail. We'll have to wait for some clarification from the WildFly team and/or EL spec team on this second JIRA.
-
6. Re: Java EE 7 + EL 3.0 + Wildfly 10 - returns empty string on constant
arthurborsboom Aug 11, 2016 10:21 AM (in response to jaikiran)Indeed, that looks like what seems to be lacking in the EL 3.0 implementation in Wildfly.
- Usage of static fields (constants) of java.lang.*
- Usage of static fields (constants) of user classes
- Usage of static methods (functions) of user classes
Thanks for your effort and let me know if I can help with something.
-
7. Re: Java EE 7 + EL 3.0 + Wildfly 10 - returns empty string on constant
jaikiran Aug 11, 2016 10:36 AM (in response to arthurborsboom)Just for my curiosity - does this work on any other EE7 server, in case you have had a chance to try it?
-
8. Re: Java EE 7 + EL 3.0 + Wildfly 10 - returns empty string on constant
arthurborsboom Aug 11, 2016 11:00 AM (in response to jaikiran)Unfortunately I have no access to another Java Application Server capable of EE7 and EL 3.0.
However, another person at stack overflow reported that it worked for him at Websphere (see the first comment):
eclipse - Java EE 7 + EL 3.0 + Wildfly 10 - returns empty string on constant - Stack Overflow
-
9. Re: Java EE 7 + EL 3.0 + Wildfly 10 - returns empty string on constant
jaikiran Aug 11, 2016 10:23 PM (in response to jaikiran)Both these JIRAs have now been resolved and the code has been merged to WildFly upstream. The fix should be available in the upcoming WildFly 10.1.0.Final release.
-
10. Re: Java EE 7 + EL 3.0 + Wildfly 10 - returns empty string on constant
arthurborsboom Aug 12, 2016 3:25 AM (in response to jaikiran)Awesome, nice work!
Since I would like to use this functionality in my current project, do you have any guess about the release schedule 10.1?
Is it (usually) within a week, month, months, year or years?
-
11. Re: Java EE 7 + EL 3.0 + Wildfly 10 - returns empty string on constant
jaikiran Aug 12, 2016 10:05 AM (in response to arthurborsboom)Arthur Borsboom wrote:
Awesome, nice work!
Since I would like to use this functionality in my current project, do you have any guess about the release schedule 10.1?
Is it (usually) within a week, month, months, year or years?
The WildFly team can provide a more definitive answer but from what I have read in the dev mailing list the 10.1.0.Final is planned very soon which I think means sometime this month or soon (given that they just released a CR a few weeks back).
To test out the fix, I would have pointed you to use a nightly build but it looks like there isn't one for the 10.x branch (from which the 10.x releases are done).
-
12. Re: Java EE 7 + EL 3.0 + Wildfly 10 - returns empty string on constant
arthurborsboom Aug 12, 2016 10:12 AM (in response to jaikiran)The nightly build will do for now.
At least we can continue developing with this build.