• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

EL & Bean Collections

 
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.




 
Bartender
Posts: 1845
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?
 
We cannot change unless we survive, but we will not survive unless we change. Evolving tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic