Bean data source is used to import data from a bean found from a servlet request object. The data can be imported from properties serving Java Collections. The objects in Collections are mapped to data values.
The bean can be added to the request object with JSP scriplet:
<% request.setAttribute("ownBean",BeanInstance); %>
or with useBean tag:
<jsp:useBean id="ownBean" scope="request" class="BeanClassName" />The given name is used to refer to the bean in the Chart XML.
Assume that one has a dataBean having properties salesPersons and sales. Methods getSalesPersons() and getSales() returns a Java Collection.
<data>
<bean source="ownBean">
<beanColumn column="sales" type="value"/>
<beanColumn column="salesPersons" type="label"/>
</bean>
</data>
The above example would import two data columns, sales and salesPersons. The label column is assumed to contain text data.
|
| Sales and sales persons names extracted from a bean. |