dcsimg
URGENT! How to display records from a table in struts 1.1b2 using jsp to display records with a button and jdbc result set to fetch records..
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   chocks_karapagavinayagam
Posted On:   Wednesday, December 18, 2002 06:02 AM

Can anyone give me an example or guide me thru to display records in jsp fetched from the database ( jdbc ) in struts
1.1b2.

Thanks in advance
chocks

Re: URGENT! How to display records from a table in struts 1.1b2 using jsp to display records with a button and jdbc result set to fetch records..

Posted By:   venu_reddy  
Posted On:   Friday, December 27, 2002 11:36 AM

Hi Vinay,


You can display the records in jsp by using logic iterator tag. Iterate over the resultset to display.



In the Action Class set the Resultset as a request attribute



httpServeletRequest.setAttribute("Result",rs);



and in the jsp page get the ResulteSet and typecaste it to the ResultSet and use the ResultSet as normal ResultSet.



Ex:

ResultSet rs1 = (ResultSet)request.getAttribute("Result");




while(rs1.next())
{
rs1.getString(1);
rs1.getString(2);
}



Hope this should work. I think you can use the logic Iterator tag to display the ResultSet.
About | Sitemap | Contact