关于JSONObject类型返回值在jsp页面循环遍历问题??

java后端

    // 查询培训类型,前端使用select选择。
   Result resultType = Invoker.invoke("J_THP_002_0102", null, page);
   JSONObject bodyType = (JSONObject) resultType.getBody();
   System.out.println(bodyType);
   // 将培训类型放入servletContext域中,用于跨页面获取。
   ServletContext application = request.getSession() .getServletContext();
   application.setAttribute("noticeType",bodyType.get("type"));

获取的数据格式为:

{"returnCode":"200","returnMsg":"查询成功","type":[{"ttType":"技术类","ttId":"a6a9fda2ef2e4013a9b29d45209c4bb5"},{"ttType":"管理类","ttId":"cdffa8fb52fc447eb3b473bf1bbef60c"},{"ttType":"其他","ttId":"214dc36b904e4893b2719e53bcddc36d"}}]

前端jsp页面

<div class="layui-form-item">
                <label class="layui-form-label">培训类型</label>
                <div class="layui-input-block">
                 <select id="ttId" name="ttId" required lay-verify="required>
                  <option value="">请选择类型</option>
                  <c:if test="${application.getAttribute('noticeType')!=null}">
                   <c:forEach var="type" items="${application.getAttribute('noticeType')} ">
                    <option value="${type.ttId) }">${type.getttType}</option>
                   </c:forEach>
                  </c:if>
                 </select>
                </div>
            </div>

请问数据格式怎么处理可以在jsp页面获取值???
谢谢

application.getAttribue("noticeType")获取到的是jsonobject对象,不是数组,需要在获取一次层。
application.getAttribue("noticeType").get("type")才是数组,c:foreach才可以进行迭代

application.setAttribute("noticeType",JSON.parseArray(bodyType.get("type")));