This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Java String Array variable in JSP to a javascript function? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Java String Array variable in JSP to a javascript function?" Watch "Java String Array variable in JSP to a javascript function?" New topic
Author

Java String Array variable in JSP to a javascript function?

Ambika Jain
Ranch Hand

Joined: Jan 27, 2005
Posts: 48
I have a javascript functioned defined which accepts a String array as the input. I am not able to do this.

Thanks,
Amba
[ November 21, 2006: Message edited by: Bear Bibeault ]

Ambika Jain
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

You can't. The Java construct exists on the server. The JavaScript executes on the client.

Please read this article for a better understanding of JSP.

What you can do is to use the JSP to write javaScript syntax into the page that re-creates the string array in JavaScript.
[ November 21, 2006: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java String Array variable in JSP to a javascript function?
 
Similar Threads
How i write in a servlet response an javascript array?
passing java string array to javascript
Convert Java Array to JavaScript Array.
determining if a variable is a number
passing two arrays to Javascript function