Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

inject DAO in JSF converter

 
Alec Swan
Ranch Hand
Posts: 39
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have selectOneListbox JSF component, which I populate with a list of MyItem objects, where MyItem class extends javax.faces.model.SelectItem.

I created MyItemConverter, which has getAsString(..) method that converts a given MyItem instance to String. However, in order to implement getAsObject(..) I need to look up MyItem record in the database by its String representation.

So, my question is how can I inject a MyItemDAO instance into MyItemConverter to allow the converter to use the DAO to look up the item from the database?

Thanks.

Alec
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic