Possible Duplicate:
Reference interface constant from EL
So I have a JSP that currently has no scriptlets in it, i.e. there are no occurrences of "<%" (with the exception of "<%@") and instead multiple occurrences of "${javaVar}", which is EL.
I now need to add something like this:
<security:hasPermissionTo functionKey="<%= FunctionKeyConstants.CREATE %>" ...
But I don't want to break the convention of this JSP. Can I do this using EL? Or any other suggestions?
Java Class
public class FunctionKeyConstants{
public static final String NAME="Jigar";
public String getNAME(){//NOTE THAT ITS NOT STATIC
return NAME;
}
}
JSP
<jsp:useBean id="cons" class="com.example.FunctionKeyConstants" scope="session"/>
then
${cons.NAME}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With