I'm trying to use "Tag-it" jQuery UI plugin with Spring MVC
My controller gets list of available tags from DAL and add it to model as attribute:
@RequestMapping(value = "/", method = RequestMethod.GET)
public String home(Model model){
DAL dal = new DAL();
model.addAttribute("FBAppId", ConfigurationManager.getInstance().getFBAppId());
model.addAttribute("FBAppSecret", ConfigurationManager.getInstance().getFBSecret());
model.addAttribute("tags", dal.getAllTags());
return "home";
}
Then I want to read it in view and pass it as list of available tags:
$(document).ready(function() {
$("#myTags").tagit({
availableTags: '${tags}'
});
$.ajaxSetup({ cache: true });
$.getScript('//connect.facebook.net/en_UK/all.js', function(){
FB.init({
appId: '${FBAppId}',
channelUrl: '//yourapp.com/channel.html',
});
$('#loginbutton,#feedbutton').removeAttr('disabled');
FB.getLoginStatus(updateStatusCallback);
FB.XFBML.parse();
});
});
However what interpreted is : "[tag1, tag2]" instead of ["tag1", "tag2"]
Does somebody know how to solve this issue?