This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes create a js array on the server-side Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "create a js array on the server-side" Watch "create a js array on the server-side" New topic
Author

create a js array on the server-side

Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
I am trying to create an array as a String and then use a JSP bean:write tag to display the array as javascript. The problem I am running into is the double quotes are not appearing as double quotes when I view source of the page. The double quotes are shown as ""e;". Any ideas how I can get the javascript to display the double quotes?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15357
    
    6
I am just getting into this Java stuff so this is a shot in the dark. Most serverside code will spit out the entities which is the proper way for characters to be displayed in HTML. You need to turn that off. I think it is done with this:

<bean:write name="foobar" filter="false"/"

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: create a js array on the server-side
 
Similar Threads
assign a jsp bean to a javascript array
Struts ActionMessage not displaying multiple dynamic values
Expression Language
How to pass strings with double quotes to method out.println()
Creating a table cell with text containing an apostrophe