I am working on a code where I need to fetch tweets using an API and display on a google map. I am using JSPs and Servlets.
Everything is working fine, except for one part :
I am not able to display the content of the tweets that I am fetching. Following is the code for same -
<% String TweetText= tweet.getText(); %> => This is working fine as TweetText is getting the content (Most of the times the tweets have special characters)
But when I use the following code, the code breaks and I am not able to understand what is going wrong.
var Temp= <%= TweetText%>;
I used various functions like encodeURI() function, stringconversion functions, but nothing seems to work. It is also not working for tweets with no special chars.
I am new to JSP, so I am not sure if there is something very basic that I am missing out here.