Meaningless Drivel is fun!*
The moose likes Struts and the fly likes Struts 2 and Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 and Hibernate" Watch "Struts 2 and Hibernate" New topic
Author

Struts 2 and Hibernate

Jay Abrahm
Ranch Hand

Joined: May 28, 2008
Posts: 183
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: May 28, 2008
Posts: 183
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

Joined: May 28, 2008
Posts: 183
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
 
 
subject: Struts 2 and Hibernate
 
Similar Threads
Nested Model Class + ModelDriven + Struts 2
Struts2 valuestack error
Xhtml tag
selecting a value in dropdown
how to get selected value from s:select tag in struts 2