Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 and Hibernate

 
Jay Abrahm
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can struts directly handle hibernate objects like...

where userIdList is a hibernate object that I have served in the action class


 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happened when you tried it?

(And what's a "Hibernate object"? Aren't they just POJOs, possibly annotated and/or proxied?)
 
Jay Abrahm
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe I should have added some more detail. I was trying to move away from using POJOs defined in the action class and directly using the hibernate pojo object ;-)

But it returned the correct number of entries in the drop down without translating its values. It just listed all the entries as com.hibernate.objectClass
 
Jay Abrahm
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I wasn't taking care of what syntax I was using.

In case anyone else comes with a list of object names instead of the actual values one of the possible reasons could be -

You have used key="" value="" instead of listKey/listValue
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic