0
$items .= <<<EOD  
{
    "s": "0",  
    "f": "{$chat['from']}",  
    "m": "{$chat['message']}"  
},  
EOD;  

is there any equivalent type method in jsp?

hexacyanide
  • 88,222
  • 31
  • 159
  • 162
  • How to convert this php code to jsp – Rajeev Rajan Feb 26 '14 at 15:46
  • If you can't convert string from one language to another, then I'm afraid you need to learn language syntax. If you came here to get copypaste solutions, then you're at the wrong place. – N.B. Feb 26 '14 at 15:48
  • AFAIK you could use a `StringBuilder` and append the necessary lines and variables (using their `toString` method) to build your String and assign it into another `String` variable using scriptlets, but [it's use is highly discouraged](http://stackoverflow.com/q/3177733/1065197) – Luiggi Mendoza Feb 26 '14 at 16:26

1 Answers1

0

The notation is called heredoc also know as here-doc.

AFAIK, not possible in jsp, but there are rumors about some hacks that can enable it.

enterx
  • 869
  • 4
  • 14