以我彈簧項目,我有我的意見兩層:JSP:PARAM不顯示預期值
1)從我的控制器直接映射一個jsp頁等,每個方法:
<jsp:include page="../../common/listagem.jsp">
<jsp:param name="name" value="Usuario"/>
<jsp:param name="elements" value="{['login','senha','pnome','unome','email']}"/>
</jsp:include>
2)我的jsp頁面常見/ listagem.jsp是這樣的:
<%@ include file="../include/header.jsp" %>
<sec:authorize access="hasPermission(#user, 'cadastra_${param.name}')">
<p>
<button type="button" class="btn btn-sm btn-link link" data-action="/${param.name}/cadastra">
Cadastrar novo ${param.name}
</button>
</p>
</sec:authorize>
<table class="bordered">
<thead>
<tr>
<c:forEach var="item" items="${param.elements}">
<th> <c:out value="${item}"/> </th>
</c:forEach>
</tr>
</thead>
<tbody class="content">
</tbody>
<tfoot>
<tr>
<sec:authorize access="hasPermission(#user, 'altera_${param.name}')">
<td class="comando" data-nome="Altera" data-action="/${param.name}/altera"></td>
</sec:authorize>
<sec:authorize access="hasPermission(#user, 'remove_${param.name}')">
<td class="comando" data-nome="Remove" data-action="/${param.name}/remove"></td>
</sec:authorize>
</tr>
</tfoot>
</table>
<c:url value="/${param.name}/listagem.json" var="listagem"/>
<script>
$(document).ready(function(){
load_content("${listagem}", $('table.bordered'));
});
</script>
<%@ include file="../include/footer.jsp" %>
我的問題也正是上面的頁面。該代碼的最終結果是:
而是應該顯示在頂部欄的只有標題和代碼:
<c:url value="/${param.name}/listagem.json" var="listagem"/>
<script>
$(document).ready(function(){
load_content("${listagem}", $('table.bordered'));
});
</script>
應填寫表格與數據服務器(這個代碼在我的其他項目中工作,我不使用include文件和jsp:param)。
任何人都可以看看有什麼不對的代碼?
你期待什麼?它是字符串,並按原樣顯示。 – Braj
難道你錯過了'$'? – shmosel
@Braj我應該使用什麼形式? –