<%@include file="">中不能拼字符串吗

b13049460 2012-02-29 10:13:34
<%@include file="test"+${type}+".html">
include标签可以这么用吗,我这么用报错
...全文
79 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
MiceRice 2012-02-29
  • 打赏
  • 举报
回复
不能,<%@include也属于编译标签,优先级都一样高。
jasmine123 2012-02-29
  • 打赏
  • 举报
回复
1、<%@ include file="" %>是指静态包含文件,即在编译时插入包含的文件。file不能为一变量URL,也不可以在file 所指定的文件后接任何参数,file 所指的路径必须是相对于此JSP 网页的路径。例:<%@ include file="common.inc" %>
2、<jsp:include page="" />是指动态包含文件。
<jsp:include page="{urlSpec | <%= expression %>}" flush="true | false " />

<jsp:include page="{urlSpec | <%= expression %>}" flush="true | false" >
<jsp:param name="PN" value="{PV | <%= expression %>}" /> *
</jsp:include>
chen2319 2012-02-29
  • 打赏
  • 举报
回复
恩 @include是指令,在用的时候是不能传参数的。
建议使用<jsp:include>标签来实现。

<%String myPage= "/includes/" + id+ "/aaa.html"; %>
<jsp:include page="<%=myPage%>"></jsp:include>
MiceRice 2012-02-29
  • 打赏
  • 举报
回复
用这个:
<jsp:include page="<%=xxoo%>"/>
b13049460 2012-02-29
  • 打赏
  • 举报
回复
用什么方法能实现同样功能呢

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧