That's a tough one. There's obviously no
instanceof capability. The basic question becomes, why are you creating such an unfriendly construct in the first place?
The rule of thumb os to use constructs that are JSTL and EL-friendly, rather than trying to do contortions on the
JSP to accommodate constructs that are difficult.