0

私はSpringMVCを使用して小さなWebアプリを開発しています。変数を表示してから、フロントエンドからjstlとして表示します。私のメインページには

function getExecJob(execid){
alert(execid);
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
      document.getElementById("execDetailDiv").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","execJobDetail.action?execId="+execid,true);
xmlhttp.send();

}

execJobDetail.actionリターンページexecJobDetail.jsp、

                    <div id="status_code_div">
                        HTTP Status Code Summary <br/>
                            <table width="523" id="http_status_code_table">
                                    <tr>
                                        <th width="268" >HTTP Status Code</th>
                                        <th width="129" ># of Urls</th>
                                        <th width="110" >%</th>
                                     </tr>
                                    <c:forEach var="entry" items="${reportMap}">
                                    <tr>
                                        <td scope="col" class="row_type"> ${entry.key}</td>
                                        <td scope="col" class="row_value">${entry.value}</td>
                                        <td scope="col" class="row_value">${(entry.value)*1.0/toal}</td>
                                </tr>
                            </c:forEach>
                            </table>
                    </div>
                    </c:if>

しかし、それは常にjstlのものを空白のままにしてページを返します。誰かが私にいくつかの提案をしてくれませんか!!!! ありがとうございました !!!

4

1 に答える 1

2

これは、JSP の上で JSTL taglib を実際に宣言していない場合に発生する可能性があります。この方法では、解析も処理もされず、生成された HTML 出力でプレーン テキストとして終了します。

次の行を JSP の先頭に追加して、JSTL taglibs を実行します。

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

以下も参照してください。

于 2012-04-26T21:42:27.903 に答える