gri*_*egs 12 java jsp jspinclude
我有一个Java thgat需要使用的项目;
<%@include file="content.jsp" %>
Run Code Online (Sandbox Code Playgroud)
将文件包含到当前的jsp页面中.
但是,我现在需要content.jsp是动态的.
如何用变量替换引号中的所有内容?
所以;
<%@include file=myVariable %>
Run Code Online (Sandbox Code Playgroud)
lim*_*imc 37
您可以使用动态包含,而不是使用静态包含,然后您可以执行以下操作: -
<jsp:include page="<%= myVariable %>" flush="true" />
Run Code Online (Sandbox Code Playgroud)
要么
<jsp:include page="${myVariable}" flush="true" />
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
28449 次 |
| 最近记录: |