Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJWCD
Search Coderanch
Advance search
Google search
Register / Login
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
Forum:
Web Component Certification (OCEJWCD)
Assignment of an Array to a key
Padma priya Gururajan
Ranch Hand
Posts: 437
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
Please look at the following code:
String
[] favoriteMusic = { "Zero7","BT","Frou Frou"};
request.setAttribute("musicList","favoriteMusic");
Is it correct to assign a string array to a key called "musicList".
With regards,
Padma priya N.G.
Padma priya N.G.
Be the change you want to be - Mahatma Gandhi
Christophe Verré
Sheriff
Posts: 14691
16
I like...
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You've got extra double quotations. It should be :
String[] favoriteMusic = { "Zero7","BT","Frou Frou"}; request.setAttribute("musicList",favoriteMusic);
Yes it's ok, because as you know, arrays behave like any objects.
[My Blog]
All roads lead to JavaRanch
Padma priya Gururajan
Ranch Hand
Posts: 437
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
Thanks.
Padma priya N.G.
Padma priya N.G.
Be the change you want to be - Mahatma Gandhi
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Unable to understand the solution on EL
Unable to display the content in array(created in the servlet)using JSP!
Unable to display arrays in JSP
EL and quotes (HFSJ pg373)
HFSJ EL e.g. page 371
More...