问题
When a jsp page includes jsp dynamic includes...
<jsp:include page=”filename.jsp” />
...is it possible that the document onload event (or prototype's dom:loaded event) could get fired too early? (i.e. before the included filename.jsp has fully loaded)
The reason I suspect this may be the case is that the included file is compiled separately and only included by directive at runtime. The parent jsp might assume that loading of the directive itself is sufficient to consider the DOM is loaded - the includes page is loaded asynchronously and its loading is might not be monitored by the document.
Is this a valid concern?
Thanks in advance
回答1:
This is included serverside, not clientside. It's certainly not asynchronously. The client receives one response. Rightclick page and view source. It's all plain HTML.
If you have problems with onload, it lies somewhere else. Verify/validate the generated HTML output.
来源:https://stackoverflow.com/questions/2702780/onload-can-fire-early-when-using-jsp-dynamic-includes