特定のオブジェクトからヘッダ名と必要なプロパティを指定することで、動的グリッドを作成するためのリファレンスとしてこのドキュメントの例を使用しています。 http://jxls.sourceforge.net/samples/dynamic_grid.htmlJXLS動的グリッドでNestedNullExceptionがスローされる
しかし、私の場合にはEmployee
オブジェクトがネストされているプロパティ「adres.housenumber」
public class Employee {
private String name;
private Date birthDate;
private BigDecimal payment;
private BigDecimal bonus;
private Adres adres;
// constructors and getters/setters
.....
}
public class Adres {
private String housenumber;
}
すべての従業員が、housenumber
で従業員がADRESを持っている場合は、私は例外の下になったadres
を持っている場合、それは正常に動作しますorg.apache.commons.beanutils.NestedNullException:::によって引き起こさ
のBeanクラスのクラスEmployee「オン 'adres.housenumber' のNULLプロパティ値
org.apache.commons.beanutils.PropertyUtilsBean.getNestedPropertyで(PropertyUtilsBean.java:795)〜[コモンズ-々BeanUtils-1.9.3.jar:1.9.3]
org.apache.commons.beanutils.PropertyUtilsBeanで.getProperty(PropertyUtilsBean.java:884)〜[commons-beanutils-1.9.3.jar:1.9.3]
at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:464)〜[commons- org.jxls.command.GridCommand.processBody(GridCommand.java:185)〜[jxls-2.3.0.jar :?]
at org.jxls。 command.GridCommand.applyAt(GridCommand.java:137)〜[jxls-2.3.0.jar :?]
at org.jxls.area.XlsArea.applyAt(XlsArea.java:168)〜[jxls -2.3.0.jar :?] org.jxls.util.JxlsHelper.processGridTemplate(JxlsHelper.java:156)〜[jxls-2.3.0.jar :?]
で
をこの従業員データがありますデータベースから取得したので、Excelにエクスポートする前に変更するアクセス権がありません。
どのようなアイデアや助けてください?