当前位置: 代码迷 >> J2EE >> spring mvc3 使用jackson返回json时分出现500Internal Server Error
  详细解决方案

spring mvc3 使用jackson返回json时分出现500Internal Server Error

热度:67   发布时间:2016-04-19 22:19:00.0
spring mvc3 使用jackson返回json时候出现500Internal Server Error
求助啊
   我使用jquery+Springmvc实现ajax,获得后台传递的集合。出现了500 Internal Server Error。求大神解救。。。
   页面代码如下:
function AjaxGetData( index, size) {
        $.ajax({
            url: "${pageContext.request.contextPath}/showAllProduct.do",
            type: "Get",
            data: "pagenum=" + index + "&pagesize=" + size,
            dataType: "json",
            success: function (json) {
                
                 var html = "";
                 html += "<table>";
                 html += "<thead>";
                 html += "<tr><td>商品编号</td><td>商品名</td><td>商品规格</td><td>计量单位</td><td>商品类别</td><td>产地</td><td>建议采购价格</td><td>建议销售价格</td><td>操作</td></tr>";         
                 html += "</thead>";
                 html += "<tbody>";      
               for(position in json){
               html += "<tr>";
                html += "<td>"+json[position].productID+"</td>";
                   html += "<td>"+json[position].name+"</td>";
                   html += "<td>"+json[position].model+"</td>";
                   html += "<td>"+json[position].baseunit+"</td>";
                   html += "<td>"+json[position].type.type+"</td>";
                   html += "<td>"+json[position].productAddress+"</td>"; 
                   html += "<td>"+json[position].suggestPrice+"</td>"; 
                   html += "<td>"+json[position].salePrice+"</td>"; 
                   html+="<td><input type='button' value='修改' onclick='update("+json[position].productID+")'/><input type='button'value='删除' onclick='deleteEmployee("+json[position].productID+")'/></td>";
                   html += "</tr>";
               }
               html += "</tbody>";
              
              html += "<tfoot>";
              html += "<tr>";
              html += "<td colspan='7'>";
              html += "<a href='javascript:void' onclick='GoToFirstPage()' id='aFirstPage' >首页&nbsp;&nbsp; </a>";
              html += "<a href='javascript:void' onclick='GoToPrePage()' id='aPrePage' >上一页&nbsp;&nbsp; </a>";
              html += "<a href='javascript:void' onclick='GoToNextPage()' id='aNextPage'>下一页&nbsp;&nbsp; </a>";
              html += "<input type='text' size='4' /><input type='button' value='Jump' onclick='GoToAppointPage(this)' /> ";
  相关解决方案