edited
You can not do this with JSTL standard.
Using scriptlet, be it a line <% =%>
or more <% %>
JSP goes through the translation phase of JSP page to then be compiled into a servlet.
During the translation of the instructions are inserted into the Scriptlet _jspService() method in the same way on the Web page. The _jspService () method Corresponds to the body of the JSP page.
In your case, it's like generated a line like this:
out.write("<a href=\" + UrlConstants.ADJUSTMENT_NOTE_LEDGER_SUGGEST_BOX + "\" >Load Demo</a>" );
So this works with scriptlets. With JSTL is a little different.
The EL allows page authors to use expressions to dynamically read application data stored in JavaBeans components, various data structures, and implicit objects.
These expressions are evaluated at the appropriate time and supports immediate and deferred evaluation.
Immediate evaluation means that the expression is evaluated and the result returned as soon as the page is first rendered.
Deferred evaluation means that the technology using the expression language can use its own machinery to evaluate the expression sometime later during the page’s lifecycle, whenever it is appropriate to do so. In the case of JavaServer Faces technology.
All expressions using the ${}
syntax are evaluated immediately, this is made by ELResolver
, ELContext
and other objects. At the center of the EL machinery is the extensible ELResolver class.
A class that implements ELResolver defines how to resolve expressions referring to a particular type of object or property. In terms of the following expression, a BeanELResolver
instance is called the first time to find the base object, employee, which is a JavaBeans component. Once the resolver finds the object, it is called again to resolve the property, lName of the employee object.
${employee.lName}
The unified EL includes a set of standard resolver implementations: ArrayELResolver
, BeanELResolver
, ListELResolver
, MapELResolver
and ResourceBundleELResolver
. JSP 2.1 provides two EL resolvers to handle expressions that reference these objects: ImplicitObjectELResolver
and ScopedAttributeELResolver
.
Depending on the technology using the unified EL, other resolvers might be available. In addition, application developers can add their own implementations of ELResolver
to support resolution of expressions not already supported by the unified EL by registering them with an application.
So, by default EL does not evaluate the constant value of the mode you want.
See this link for more details: http://docs.oracle.com/javaee/5/tutorial/doc/bnahq.html
see this link How to reference constants in EL? There have several options to solve your problem