I’m trying to pass a String variable into my javascript function, but my variable has a multiple lines: For example :
String info = "aaaa \n bbb \n ccc";
I need this form to properly display it. And now I have a “result” Java Object with info field and I can’t pass this to my javascript function.
popupErrors('$!{result.info}')"
The problem is that result.info is put here as a whole text with new lines. How can I solve this problem?
Maybe popupErrors is displaying the string an an HTML popup instead of say a javascript alert. So the new lines are not getting show, you’d need to replace
\nwith<br/>so they show up in HTML.OR
Maybe
$!{result.info}is automatically HTML encoding your\nto