The C:foreach problem of "original" in Jstl label

Source: Internet
Author: User

One such problem has been encountered in applying the JSTL label C:foreach:

[Servlet error]-[action]: javax.servlet.jsp.JspException:An Error occurred while evaluating custom action attribute "Val UE ' with value ' ${claim.cltnum} ': Unable to find a value for ' cltnum ' in object of class ' Com.data.Claim ' using operator ." (NULL)

The literal meaning is: No Cltnum object was found ********

The investigation found that the causes of this problem are as follows:
In the Jstl tab, do the following when you c:foreach the action:
<c:foreach item= "${claimlist} var=" claim ">
<TR><TD nowrap class= "aTabletitle3" align= "Center" >
<div align= "center" >
<c:out value= "${claim.cltnum}"/>
</div>
</td></tr>
</c:foreach>

At this point, Jstl goes through the claimlist information and stores the information in a single object claim, and then in "${claim.cltnum}" it looks for claim's Getcltnum () method to get the Cltnum information.

But Strange is in jstl in the field of writing requirements very strict, a little problem will be an error, now is the problem caused by error is cltnum,
The rule that defines the domain in the JavaBean is incorrect, instead of "private String cltnum" There is no problem, similarly if it is cltnum will be the same error. JavaBean domain naming rules must ensure that the first letter and the second letter must be uppercase to be valid, otherwise, the C:foreach will be an error.

Remember to remember ...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.