我正在使用spring mvc开发一个小的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内容留空。有没有人能给我一些建议!谢谢!
发布于 2012-04-27 05:42:28
如果您还没有在JSP之上实际声明JSTL标记库,就会发生这种情况。这样,它既不会被解析,也不会被处理,最终会在生成的HTML输出中成为纯文本。
将以下行添加到JSP顶部,以运行JSTL标记库:
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>另请参阅:
https://stackoverflow.com/questions/10339187
复制相似问题