struts2 - how to get property value from java bean in javascript without replacing the special characters -


i have struts2 application , trying show kml layer on top of google earth using google earth plug-in. using: ge.parsekml(kmlstring)

if put kml string in script section such var kmlstring ='<?xml version=\"1.0\" encoding=\"utf-8\"?> <kml xmlns=\"http://www.opengis.net/kml/2.2\"> <document> <camera> <longitude>-122.444633</longitude> <latitude>37.801899</latitude> <altitude>139.629438</altitude> <heading>-70.0</heading> <tilt>75</tilt> </camera> <placemark> <name>placemark kml string</name> <point> <coordinates>-122.448425,37.802907,0</coordinates> </point> </placemark> </document> </kml>';

then marker shows on globe. problem kml string not fixed, generated after user selects values. getting kml string java bean class property "kmlstr" this:

var kmlstring='<s:property value="kmlstr"/>';

the problem following special characters replaced '<' becomes '&lt;' , '>' becomes '&gt;'
breaks "parsekml" method since greater , less symbols not interpreted (the marker not show up).

so question how can string java bean property 'kmlstr' without '<' , '>' being replaced "&lt;" , "&gt;" respectively ?

i think can use either:

var kmlstring='<s:property value="kmlstr" escape="false"/>'; 

or

var kmlstring='<s:property value="kmlstr" escapehtml="false"/>'; 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -