*
The moose likes Struts and the fly likes Creating JSON object in struts2 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 » Frameworks » Struts
Bookmark "Creating JSON object in struts2" Watch "Creating JSON object in struts2" New topic
Author

Creating JSON object in struts2

James Peter
Ranch Hand

Joined: Sep 15, 2010
Posts: 115
Hi,

below is code in jsp



The string which comes in globalErrorMessage is

below is code in javascript



then I am getting below error.



Please let me know how to avoid this error.

if I put directly in jsp without using <s:property> then It is not showing any error.

Rgds
Peter
James Peter
Ranch Hand

Joined: Sep 15, 2010
Posts: 115
I found that we just need to add escape=false.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Creating JSON object in struts2
 
Similar Threads
Need help understanding Dojo Struts2 ajax tree generation
dyanmic part of the script tag does not get evaluated
Need help with JSTL: setting end attribute dynamically of "substring" tag
<s:property value=""> in comparison
struts2 with Jquery javascript issue