问题
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