0

I dont want to use view but I would like to render text and image on webpage, any suggestion? tried like returning String with the img tag src=bytearray but it doesnt render image (other text are rendered ok) any suggession please?

Controller goes like this

@RequestMapping(value="", method= RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
@ResponseBody
String generateTextMessage(@RequestParam("id") final String guid, @RequestParam("key") final String pID);

String being returned from contorller

info="data to be displayed on browser"+ name
info=info+ "+ " Photo: <IMG SRC=\"data:image/jpeg;base64,"+photo.getimPhoto().toByteArray() +"\" height=\"100\" width=\"100\" alt=\"testpic\" >";

Any help appreciated.

Ayush
  • 741
  • 9
  • 19
Jagruti
  • 43
  • 10

0 Answers0