I am trying to implement autocomplete feature of jQuery in a JSF (.jsp) file. Things are working fine but I am unable to fetch a list from my managed bean into a variable in the script. Please help me out.
JSP code:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function() {
var availableTags = "#{aCTestBean.placesList}";
$( "#tags" ).autocomplete({
source: availableTags
});
});
</script>
</head>
<body>
<f:view>
<label for="tags">Symbol: </label>
<h:form id="watchListForm">
<h:inputText id="tags" />
</h:form>
</f:view>
</body>
</html>
ERROR: HTTP Status 500 - /AutoComplete.jsp (line: 14, column: 24) #{...} is not allowed in template text