0

Possible Duplicate:
How to reference constants in EL?

Let's say I have a class with a static final int field, and I have imported a class in a jsp page:

<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%@ page import="com.mycompany.Object" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head></head>
<body>
    The static field with EL is: ${Object.STATIC_FIELD} <br />
    The static field with Scriptlet is: <%=Object.STATIC_FIELD%> <br />
    El and pageScope (doesnt work either): ${pageScope.Object.STATIC_FIELD}
</body>
</html>

Accessing with scriptlet works, but not with EL.

Community
  • 1
  • 1
bluefoot
  • 10,220
  • 11
  • 43
  • 56

0 Answers0