1
我取決於一些條件有BeanELResolver @覆蓋的getValue(ELContext上下文中,對象的基礎上,對象屬性)
public class ExtendedBeanELResolver extends BeanELResolver {
private static final Pattern regExpDn = Pattern.compile("PLMN-PLMN/\\w+.\\d+(.*)");
@Override
public Object getValue(ELContext context, Object base, Object property)
try {
// remake DIST.NAME appearance
if (property.equals("dn") && base instanceof Alarm && ((Alarm) base).getCustomer().getNameEng().equalsIgnoreCase("mts")) {
String dn = null;
try {
dn = ((Alarm) base).getDn();
Matcher mtch = regExpDn.matcher(dn);
mtch.find();
((Alarm) base).setDn(mtch.group(1));
} catch (Throwable e) {
// logger.error("error in dn - " + dn);
} finally {
return super.getValue(context, base, property);
}
}
}
用於改變一些可見值對象。我不想改變價值,如果這從jsf <ui:param name="fullDistName" value="#{alarm.dn}" />
調用我怎麼能得到這個EL所稱的組件的ID? 對不起,我的英語。