Answer: implement dynamic INCLUDE with jsp: include action
<Jsp: include page = "embedded DED. jsp" flush = "true"/> It always checks changes in the contained files. It is suitable for inclusion of dynamic pages and can contain parameters.
<% @ Include file = "included.htm" %> static INCLUDE is implemented by using the include pseudo code and will not check the changes to the included files. It is applicable to include static pages.
1. The result of static include is to introduce other jsp into the current jsp.
The dynamic include structure is independent of the two and will not be merged until the output (you can see the java file generated by jsp)
2. it is precisely because of this that the dynamic include jsp file is highly independent. It is a separate jsp file, and the objects and page settings that need to be used must all be created by yourself. Of course, fortunately, it is consistent with the request range of the page that includes it.
Finally, let's look at the content written out of old q.
When you use <jsp: include>, it executed the target in a separate request, and then has DES the output in the including JSP. it doesn' t include the source of the specified Ded target, it should des the output. the means by which that target output is generated is lost.
To do what you're re trying to do, you need to use <% include %> ctictives:
<% @ Include file = "/WEB-INF/jsp/include/header. jsp "%> This will incline the literal text of header. jsp into your page. of course, by doing that, you can no longer pass parameters to it, so you 'd need to set that as a page context attribute (e.g. using <c: set>... But of course you can't use <c: set> until you 've done your include ...).
Essentially, it's not really worth the hassystemic. Taglib declarations are annoying boilerplate, but hard to get rid.