mercredi 10 août 2016

check if variable is present by Reflection in JSP

I defined a variable in JSP boolean isPresent = false then in an included JSP I wrote code to check if this variable is present or not but getting NoSuchFieldException.

Class thisClass = this.getClass();
try {
    Field field = thisClass.getDeclaredField("isPresent");
}
catch (Exception ex) {
    //ToDo
}

Wondering what is wrong.





Aucun commentaire:

Enregistrer un commentaire