Reputation: 1
<script>
var availableTags = [
<% for (int i = 0; i < ApplicationName.size(); i++) { %>
<%= ApplicationName.get(i) %>
<%= i + 1 < ApplicationName.size() ? ",":"" %>
<% } %>
];
$(function() {
$( "#tags" ).autocomplete({
source: availableTags
});
});
function value()
{
alert(document.getElementById('tags').value);
var a=document.getElementById('tags').value;
return a;
}
</script>
It gives me below error:
Struts has detected an unhandled exception:
Please tell where am I going wrong.
Upvotes: 0
Views: 40
Reputation: 3830
You may try putting the following in quotes:
<%= "'"+ApplicationName.get(i)+"'" %>
Upvotes: 1