In my project, I set up the Constant
class like this
class Constant {
public static final String PARA = "para";
public Integer getPARA () {
return PARA;
}
}
in order to access the constant from the jsp through el
<!-- test.jsp -->
<jsp:useBean id="cons" class="com.test.Constant" scope="session"/>
...
${cons.PARA}
Now, in my java code, I set an attribute for that constant
// foo.java
request.setAttribute(Constant.PARA, "this is a param");
To access that attribute in the jsp, we could do ${para}
but how can I access the attribute value ("this is a param") through that constant variable cons.PARAM
? In short, how can we convert the following code into jstl ?
<%=request.getAttribute(Constant.PARA)%>