开发者

EL session object property

开发者 https://www.devze.com 2023-03-02 10:34 出处:网络
${sessionScope.pricer.applicableRateCode} public class ViewPrices implements Cloneable, Serializable {
${sessionScope.pricer.applicableRateCode}

public class ViewPrices implements Cloneable, Serializable {    
    private static final long serialVersionUID = 1;
    // fields      
    public List<RateCod开发者_JAVA技巧e> applicableRateCode = null;
}

javax.el.PropertyNotFoundException: Property 'applicableRateCode' not found on type com...ViewPrices

${sessionScope.pricer} prints value but applicableRateCode won't print


You need to add a getter method to ViewPrices. JSP EL requires them.

public class ViewPrices implements Cloneable, Serializable {    
    private static final long serialVersionUID = 1;
    // fields      
    private List<RateCode> applicableRateCode = null;

    public List<RateCode> getApplicableRateCode() {
       return applicableRateCode ;
    }
}


Setter/Getter are missing in the class . JSTL EL will access property using standard accessors methods

0

精彩评论

暂无评论...
验证码 换一张
取 消