【问题标题】:Failed to load resource: net::ERR_INCOMPLETE_CHUNKED_ENCODING error occurs when passing model attributes to the JSP page加载资源失败:net::ERR_INCOMPLETE_CHUNKED_ENCODING 将模型属性传递给 JSP 页面时发生错误
【发布时间】:2019-02-28 14:07:23
【问题描述】:

我正在将模型属性从我的 spring 控制器传递给视图,但未显示 jsp 页面。在控制台中我收到以下错误:

net::ERR_INCOMPLETE_CHUNKED_ENCODING 200

控制器:

private final String POYNT_DETAILS_VIEW = "full_poynt_view";

@RequestMapping(value = "/businessDetails/{businessId}/poynt", method = RequestMethod.GET)
public String viewBusinessDetails(Model model, @PathVariable String businessId) throws IOException {

    PoyntBusinessDetails poyntBusinessDetails = poyntApiClient.getPoyntBusinessDetails(businessId,poyntCloudBaseBusinessUrl);

    model.addAttribute("poyntBusinessDetails", poyntBusinessDetails);
    return POYNT_DETAILS_VIEW;
}

观点:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

 <div style="padding: 5px">
     <span class="main-text">Business Name</span>: 
      <span class="sub-text">${poyntBusinessDetails.legalName}</span>
 </div>

模型类:

public class PoyntBusinessDetails {
     private String legalName;

     // getters and setters
}

【问题讨论】:

    标签: spring jsp jstl


    【解决方案1】:

    代替

    <span class="sub-text">${poyntBusinessDetails.legalName}</span>
    

    使用

    <span class="sub-text"><c:out value="${poyntBusinessDetails.legalName}"/></span>
    

    【讨论】:

      猜你喜欢
      • 2015-08-17
      • 2019-08-22
      • 2014-04-08
      • 1970-01-01
      • 2019-02-20
      • 1970-01-01
      • 2014-03-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多