Current location: Hot Scripts Forums » Programming Languages » Everything Java » Passing Array from Javabean to JSP page


Passing Array from Javabean to JSP page

Reply
  #1 (permalink)  
Old 02-27-06, 04:43 PM
Vortex-Steve Vortex-Steve is offline
New Member
 
Join Date: Feb 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Passing Array from Javabean to JSP page

Hey guys,

I've decide to expand my knowledge of web based technology and have gone with Java/JSP to start with. As I'm so new to it this may be a stupid question!

I have a Javabean which is called from a JSP page. This Javabean then connects to a MySQL database and runs a query. The results of the query are then stored as a string in an array e.g. results[1] = name1, results[2] = name2 ...

This bit works fine and the array is populated as required. My problem is that I want to display the query results back on the JSP page. In the Javabean all that I seem to be allowed to return is results[x] (where X is a number), rather than the whole array. I want to have the whole array passed back to the JSP page so that I can then run a loop to expand and print it out.

I thought this would be easy enough to do, but it seems it is not as easy as expected! I cannot find any examples on the Internet and everything I have tried does not seem to work.

Since I can find no examples I guess that I am doing it all wrong, but I can't find any examples of how to do it the right way either! How should this be done so that I can get all the results back and printed on screen?

Thanks for any help.
Reply With Quote
  #2 (permalink)  
Old 03-02-06, 05:19 PM
stdunbar stdunbar is offline
Newbie Coder
 
Join Date: Jan 2004
Location: Superior, CO, USA
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Were you ok with my answer on WHT? Did is make sense?
__________________
Need Java help? Want to help people who do? Sit down with a cup of Java at the hotjoe forums.
Sure they're new - come get them started!
Reply With Quote
  #3 (permalink)  
Old 03-02-06, 05:21 PM
Vortex-Steve Vortex-Steve is offline
New Member
 
Join Date: Feb 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Yes, thanks. I'm all sorted on this bit at least!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Classified Ads skipper23 Perl 3 11-22-05 02:22 AM
Passing a variable to another page tapir PHP 8 02-16-05 05:38 PM
linking to iframe not working :( j0d JavaScript 5 01-19-04 08:14 PM
Classified Ads skipper23 Perl 2 12-30-03 03:43 AM
passing array to hidden fields in form on next page? seala ASP 2 09-04-03 02:40 PM


All times are GMT -5. The time now is 05:36 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.