Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-27-2010, 04:25 PM   PM User | #1
vish_1x1
New to the CF scene

 
Join Date: Aug 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
vish_1x1 is an unknown quantity at this point
Unhappy parsing a response object that contains string array.

Hello All,

I have a string array in a class file that contains 5 values, which I need to display on the jsp page.

but when I send it to the javascript it prints [Ljava.lang.String;@104f8b8 .

what do i do about it. I am a new to javascript.

Is there a way to get my array data from the response object.

Please help.
vish_1x1 is offline   Reply With Quote
Old 08-27-2010, 07:25 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,248
Thanks: 59
Thanked 3,998 Times in 3,967 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Nothing to do with JavaScript, per se.

The fault is in your Java code.

You *MUST* send that array as *TEXT*. That is, you will have to write Java code to convert the array into a form that JavaScript can understand.

You can *NOT* depend on Java to do the conversion for you. As you can see, it tries to convert the array to a standara Java serialized format, which nothing but Java will ever understand.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:05 AM.


Advertisement
Log in to turn off these ads.