参考错误:尝试将json对象传递给Java文件时未定义数据

时间:2018-12-06 19:08:09

标签: javascript java angularjs json oracle-sqldeveloper

我正在尝试将json对象传递给查询,以显示查询结果。我相信我所做的一切都是正确的,但我不断抛出参考错误:未定义数据。我已经尝试了一切,甚至调试和逐步执行该程序对我也不起作用,因为我的javascript断点似乎从未受到打击;与我的Java相同。

无论如何,这是我的Java代码:

    @POST
    @Path("module")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public List<ModuleProcCount> getInput(int jobId) throws IOException{
        try (Dbc dbc = vehmPool.getDbc()){
            List<ModuleProcCount> pusher = statements.inMod(dbc, jobId);
            return pusher;
        } 

    }

这是我的JavaScript:

$scope.sendJobId = function(cellVal) {
    data.jobId = cellVal;
    $http.post("rest/performance/module", data.jobId).then(function(response){
        $scope.pusher = response.data;

});
} 

这是我的html:

<table id="Table" class="JobID-table" style="text-align:center" >
                    <tr class="table-Header">
                        <th>JOB ID</th>
                        <th>TIME FOR ALL MODULES(MILLISECONDS)</th> 
                     </tr>
                     <tr class="jobID-Table-tr" ng-repeat="p in puller | orderBy : '-modCount'"> 

                            <td ng-click="sendJobId(p.modName)" class={{p.cellClass}}>
                                {{p.modName}}   
                            </td>

                            <td  class={{p.cellClass}}>             
                                {{p.modCount}}
                            </td>


                     </tr>

                </table> 

0 个答案:

没有答案