"The directive tag instructs the JSP compiler to merge contents of the included file into the JSP before creating the generated servlet code. It is the equivalent to cutting and pasting the text from your include page right into your JSP. "
This includes file somePageOfText.ext in the page. Question is, does it get the content in the page before starting the execution of jsp page ? So no matter where include directive is in the jsp code, it will be executed first and content if the included page will be pasted at the top of the page and whatever is the output of the generated servlet code will be attached to this included file content. Is this correct ?
This action directive, whenever encountered in the code, will execute this code and put the content in the original jsp page at the location where this include action is placed.
Does it mean that <jsp:include ...... /> can be placed anywhere in the jsp code ? I have seen this "include" action always at the beginning of the page.
The only difference between action and directive is that directive can be placed anywhere in the code but it will be executed first and its content will always be at the top of the page. It can include only static page. While in case of include action, it can include dynamic pages and its content will be placed at the location where its placed.
So no matter where include directive is in the jsp code, it will be executed first and content if the included page will be pasted at the top of the page and whatever is the output of the generated servlet code will be attached to this included file content. Is this correct ?
Nope. Both include directive and jsp:inlcude are position specific.
The difference is include directive makes the jsp to include the content in the translation phase and both ( included jsp and main jsp ) gets compiled after that.
Where as jsp:include includes the data at runtime , when page is being requested. Basically this achieved by kind of RequestDispatcher include() as you do in servlet.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com