1

According to this Stack Overflow answer, it should be possible to retrieve the value of a constant by using Expression Language 3.0

According to this article, Wildfly 10 has implemented Java EE 7 and EL 3.0

However, when I create a new Dynamic Web Project in Eclipse with a new empty JSP file with two constant references and deploy it to Wildfly 10, the variables are presented as empty (or non-existing).

This is the example JSP page.

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>title</title>
    </head>
    <body>
        2 + 2 = ${2 + 2}<br>
        ContextPath: ${pageContext.servletContext.contextPath}<br>
        Boolean.TRUE: ---${Boolean.TRUE}---<br>
        Integer.MAX_VALUE: ---${Integer.MAX_VALUE}---<br>
    </body>
</html>

And this is the result in the browser.

2 + 2 = 4
ContextPath: /helloworld
Boolean.TRUE: ------
Integer.MAX_VALUE: ------

What is the reason that these variables are returned empty?

Community
  • 1
  • 1
Arthur Borsboom
  • 323
  • 2
  • 10
  • Just an FYI, I tried this out on WebSphere Application Server V9 which supports EL 3.0 and it works. The output in question in my browser shows: 'Boolean.TRUE: ---true--- Integer.MAX_VALUE: ---2147483647---' Therefore this could be an issue specific to Wildfly – JayS Aug 09 '16 at 17:56
  • Note that the answer you found already mentions that some (early) servers have bugs on this. I had at the time of writing not tested WF10 on this, but I recall having tested WF8. Can you try 10.1 beta? If it also fails there, report it to WF guys as soon as you can. – BalusC Aug 09 '16 at 21:57
  • WF10.1-CR1 shows the same behavior. By now, a bug report has been created: https://issues.jboss.org/browse/WFLY-6939 – Arthur Borsboom Aug 10 '16 at 10:31
  • A patch has been created and is readied for Widlfly 10.1.0-Final, see https://github.com/wildfly/wildfly/commit/d1212ed7091627aed9696d2e5361bdf30b39e9af – Arthur Borsboom Aug 12 '16 at 07:40

1 Answers1

0

The reason why the variables are returned empty is because Wildfly 10.0 contains two bugs which result in that behavior:

  1. https://issues.jboss.org/browse/WFLY-6939
  2. https://issues.jboss.org/browse/WFLY-6943

The issue has been fixed in Wildfly 10.1, which has been released:

Wildfly 10.1.0 Final can be downloaded here:

Arthur Borsboom
  • 323
  • 2
  • 10