• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

drop down menu usinng optionCollections

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,

I have a List in my JSP which is coming from my hibernate query. It has only one column for example all the employee ids from the table. Now i want to show these emplyee ids in a drop down. I'm using optionCollections for the same but at runtime it is throwing an exception that no getter method for emp110(one of the emplyee code i.e. value in the list) under myForm bean has found.

Can anyone please tell me how can i show empids in drop down.

Thanks in Advance.

Namrta.
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Namrta Pandey wrote: no getter method for emp110(one of the emplyee code i.e. value in the list) under myForm bean has found.


You, somewhere in your JSP code has written or set a property for "emp110" and the corresponding bean doesn't have a valid getter for that property !!

So check your JSP and the underlying bean for the required property !!

HTH
 
Namrta Pandey
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
emp110 is just a value which is coming as a result of query and it can be anything, so i anyway can't set any setter and getters for these values.
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I repeat my first sentence:

You, somewhere in your JSP code has written or set a property for "emp110" and the corresponding bean doesn't have a valid getter for that property !!



that means, find out where you mistakenly declare a property attribute as "emp110".
 
Namrta Pandey
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have not declared any setter or getter method for "emp110".
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK,
1. Either you found out that in you JSP page, you somewhere assiging a dynamic value to "property" attrbute
like

2. OR post your JSP, we will find out where this thing goes wrong.
 
Namrta Pandey
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Sagar , I have resolved the problem by fetching the whole record from database instead of fetching on empCode, son now its working fine.
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I comment on this, because I didn't know how your code looks like,
Anyway, You're welcome
 
Not so fast naughty spawn! I want you to know about
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic