Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes Display JOIN TABLE values inside an Iterator in JSP Page in Struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Display JOIN TABLE values inside an Iterator in JSP Page in Struts2" Watch "Display JOIN TABLE values inside an Iterator in JSP Page in Struts2" New topic
Author

Display JOIN TABLE values inside an Iterator in JSP Page in Struts2

Neha George
Greenhorn

Joined: Jan 31, 2013
Posts: 6
Hi,

I am new to Struts and Hibernate and stuck with a problem.I have tried to retrieve datas using inner join operation from GI_detail and GI_Head tables.
I could get the datas in an ArrayList but couldnt display in jsp page.I am badly in need of your help.These are my classes.

GI_Head Class


GI_detail


///////////////////////Compound key Class of GI_detail//////////////
GIdetCmp



Action Class





Buissness Class



JSP Page



Only first value is displayed ie.giList[0] (gi_status)...giList[1](ord_qty) is not displayed.
Then i tried giList=session.createQuery("SELECT gid.ord_qty,gih.gi_status FROM GI_detail AS gid INNER JOIN gid.gi_hd AS gih").list();

<s:iterator value="giList" var="giDetail">
<s:div cssClass="rc_trdt" style="width:100px;"><s:property value="giList[0]"/></s:div>
<s:div cssClass="rc_trdt" style="width:100px;"><s:property value="giList[1]"/></s:div>[/code]

Then also only first value is displayed. ie.ord_qty

Can you please help me to solve my problem.I am stuck here.I couldnt move further.


Thanks in advance.



Neha George
Greenhorn

Joined: Jan 31, 2013
Posts: 6
Hi,

I got the solution.Hibernate itself will do the join operation by default.We need to fetch the data only from the list.


Thanks a lot...
 
wood burning stoves
 
subject: Display JOIN TABLE values inside an Iterator in JSP Page in Struts2
 
Similar Threads
Help needed for Struts2 iterator
problem while displaying foreign key data when integrating struts and hibernate
s:radio and display tag
Struts2 Checkbox: How to set value back to Bean
<s:select in <s:iterate tag displaying with comma seperated value