• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
reply
    Bookmark Topic Watch Topic
  • New Topic