• Post Reply Bookmark Topic Watch Topic
  • New Topic

EL & Bean Collections

 
Graeme Byers
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EL & Bean Collections
==============

I want my View to display items in a Collection of EmpBean.
(My EmpBean has only one field but let's imagine it contains many).

Model :

View :

Above works OK because of EmpBean.toString().
But replacing line 4 with ${eb.empName} raises :

What should I code ?

Finally :
I'm populating my EmpBean from Oracle emp table :
empNo NUMBER(4) , eName (VARCHAR2(20) , hireDate DATE ; sal NUMBER(5,2).
If I enhance my EmpBean to include these columns and in my Model's JDBC , I code as below ,
is it correct to store empNo as Integer , hireDate as Date etc or as String ? Is there a standard here ?

Thank you for any help.




 
Stefan Evans
Bartender
Posts: 1822
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you have posted here looks right.
The code looks like it should return a List of EmpBeans to your page.

EL seems to think you have a list of String objects.

Normally I wouldn't recommend scriptlet code, but for diagnostic purposes, try the following:


That should tell you exactly what objects you have in the attributes.
The EmpBean class is public right?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!