This week's book giveaway is in the Functional programming forum. We're giving away four copies of A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles and have Ben Weidig on-line! See this thread for details.
I have a url coming from my action to the jsp, 'm getting the url in my jsp.
i have to open a pop up and have to pass that url to window.open() in javascript, but the problem is my url contains special characters which i need to rewrite with escape sequence character "\",
Q) How do i get the struts2 variable which i have set as <s:set name="myVar" value="strUrl"/> (strUrl containing special characters) to the javascript to append the escape character?
You have to disable HTML in order to display HTML, so I still have no idea what isn't working.
That aside, I already told you--if you're trying to create a string usable by JavaScript you use an OGNL expression in the "value" attribute to escape the Java string. One way would be to use commons-lang's "escapeJavaScript" method thusly:
You can also set the variable first and then use it in your script using ognl.
I'll not be able to confirm the above as I can't test...
ok here is the funny thing.
i used the same thing on the property, and now i dont see the browser error.
Now, i want to see how the value looks like and i cant find the freakin code in the firebug.
it s got 12000 line of script.