How can you store JSP buffered output from an include/import to a variable?

放肆的年华 提交于 2020-01-16 08:30:09

问题


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" />

to output the generated HTML later.

How can I do this with JSP/JSTL/Struts?


回答1:


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"/>

Very useful



来源:https://stackoverflow.com/questions/2563735/how-can-you-store-jsp-buffered-output-from-an-include-import-to-a-variable

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!