I am new to JSON , im trying to display the values fetched from DataBase in jsp using JSON , I was able to conver the java object to JSON object , but its failing to display the values in jsp . Can any one help me in this case ?
Code :
<form name="viewform">
<%
List<ResourceMap> transList =(ArrayList)request.getAttribute("transaction");
GsonBuilder builder = new GsonBuilder();
builder.serializeNulls();
Gson gson = builder.create();
%>
<script>
var app = angular.module("myApp", []);
app.controller('myController', function($scope) {
$scope.jTranslist = gson.toJson(transList);
});
</script>
</form>
transList is Java object (array list) and trying to convert to json .
Problem is data is not being displayed on jsp. What exactly is the problem ??