如何将包含/导入的JSP缓冲输出存储到变量? [英] How can you store JSP buffered output from an include/import to a variable?
本文介绍了如何将包含/导入的JSP缓冲输出存储到变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不想使用任何Java代码,我只想使用<jsp:include>
或<c:import>
或类似的东西.这样我就可以使用
I don't want to use any Java code, I just want to use <jsp:include>
or <c:import>
or something to that effect. So that I can use
<c:set var="myPage" value="bufferedPageOutput" />
以稍后输出生成的HTML.
to output the generated HTML later.
如何使用JSP/JSTL/Struts做到这一点?
How can I do this with JSP/JSTL/Struts?
推荐答案
<c:import>
标签可以采用可选的var
属性,该属性将导入的内容存储为变量.
The <c:import>
tag can take an optional var
attribute, which stores the imported content as a variable.
<c:import var="myPage" url="uri/to/import"/>
这篇关于如何将包含/导入的JSP缓冲输出存储到变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文