Communication between Angular and JSTL is not possible, but you can still achieve your desired outcome. JSPs are evaluated server-side to generate static HTML sent to the client-side where Angular operates. Therefore, JSTL is evaluated server-side and cannot directly communicate with Angular.
Assuming you have assigned variables as follows:
Categories = '[{"code": "foo", ...}, {"code": "bar", ...}]'
And your JSP contains this line:
<select ng-model="detail" ng-init="Categories = '${Categories}'" ng-options="'${Category.code}' for Category in Categories">
After evaluation, Angular will see:
<select ng-model="detail" ng-init="Categories = '[{"code": "foo", ...}, {"code": "bar", ...}]'" ng-options="'' for Category in Categories">
While this may work, a better approach might be:
JSP:
window.categories = ${Categories};
If your categories variable is JSON format. If not, convert it to JSON using Jackson or manually through JSTL. Now you have a javascript variable with your categories, allowing you to use Angular logic to iterate through them.
For example, a FooController:
angular.module("controllers")
.controller("FooController", [
"$scope",
"$window",
function($scope, $window) {
$scope.categories = $window.categories;
}
]);
Now with categories in the scope, you can display them in your view like this:
<select ng-model="detail" ng-options="'category.code for category in categories">