• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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
  • 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...
    Bookmark Topic Watch Topic
  • New Topic