Monday 27 May 2013

JSP difference between include directive and include action

Tags

What is the difference between include directive and include action?


Include directiveInclude action
The include directive, includes the content of the specified file during the translation phase–when the page is converted to a servlet.The include action, includes the response generated by executing the specified page (a JSP page or a servlet) during the request processing phase–when the page is requested by a user.
The include directive is used to statically insert the contents of a resource into the current JSP.The include standard action enables the current JSP page to include a static or a dynamic resource at runtime.
Use the include directive if the file changes rarely. It’s the fastest mechanism.Use the include action only for content that changes often, and if which page to include cannot be decided until the main page is requested.



EmoticonEmoticon