Difference Betwixt Include Directive, Include Activeness In Addition To Jstl Import Tag Inward Jsp?
There are 3 principal ways to include the content of i JSP into another:
include directive
JSP include action
as well as JSTL import tag
The include directive provides static inclusion. It ads content of the resources specified yesteryear its file attribute, which could last HTML, JSP or whatever other resources at translation time.
Any alter you lot brand inwards the file to last included after JSP is translated volition non last picked upwardly yesteryear include directive.
Since JSP is translated solely i time simply tin sack last requested many times it's non a really useful option. It was originally intended to include static contents similar HTML header as well as footer for a spider web page.
The principal deviation betwixt include directive as well as include activity is that JSP includes activity provides dynamic inclusion.
The content of or hence other JSP or HTML page is included at asking time, which whatever alter you lot brand inwards the file to last included volition last visible to or hence other JSP when requested.
This is ideal if you lot are importing content from dynamic resources similar or hence other JSP page. The file to last included is specified yesteryear page attribute of jsp: include tag.
Third pick to include the output of i JSP page into or hence other is JSTL import tag. This plant pretty much similar include activity simply the principal deviation betwixt import tag as well as includes activity is that import tag tin sack include resources from the exterior world.
If you lot operate include directive or include activity you lot are solely express to include the output of resources from the same projection or or hence other spider web application residing inwards the same container.
It is the nigh powerful as well as flexible agency to include the content of i JSP to another. The file to last included is specified yesteryear url attribute of import tag.
In short
1) The principal deviation betwixt include directive as well as include activity is that the quondam is static include piece afterwards is dynamic include. Also quondam uses file attribute to specify the place of the resources to last include piece afterwards uses page attribute.
3) The fundamental deviation betwixt include activity as well as JSTL import tag is that quondam tin sack solely include local resources simply afterwards tin sack likewise include the output of remote resources, JSP pages or HTML pages exterior the spider web container. include activity uses page attribute piece import tag uses URL attribute.
That's all on the difference betwixt include direction, include activity as well as JSTL import tag inwards JSP. It's likewise an of import JSP Interview query as well as agreement these concepts volition assistance you lot to produce good inwards your side yesteryear side interview.
Further Learning
questions)Difference betwixt ServletContext as well as ServletConfig inwards Servlet? (answer) Can you lot declare Constructor within Servlet class? (answer) Difference betwixt GenericServlet as well as HttpServlet inwards Servlet API? (answer) Difference betwixt the spider web server, application server as well as Servlet container? (answer) How to handle customer session inwards a Servlet application? (answer) Difference betwixt include directive as well as include activity inwards JSP? (answer) Difference betwixt jsp:include as well as jsp:forward activity inwards JSP? (answer) 5 Courses to larn Servlet as well as JSP for gratis (courses) 20+ Spring MVC Interview Questions for Java Developers (questions)
Thanks for reading this article hence far. If you lot similar this article as well as hence delight part amongst your friends as well as colleagues. If you lot accept whatever questions or feedback as well as hence delight drib a note.
include directive
JSP include action
as well as JSTL import tag
The include directive provides static inclusion. It ads content of the resources specified yesteryear its file attribute, which could last HTML, JSP or whatever other resources at translation time.
Any alter you lot brand inwards the file to last included after JSP is translated volition non last picked upwardly yesteryear include directive.
Since JSP is translated solely i time simply tin sack last requested many times it's non a really useful option. It was originally intended to include static contents similar HTML header as well as footer for a spider web page.
The principal deviation betwixt include directive as well as include activity is that JSP includes activity provides dynamic inclusion.
The content of or hence other JSP or HTML page is included at asking time, which whatever alter you lot brand inwards the file to last included volition last visible to or hence other JSP when requested.
This is ideal if you lot are importing content from dynamic resources similar or hence other JSP page. The file to last included is specified yesteryear page attribute of jsp: include tag.
Third pick to include the output of i JSP page into or hence other is JSTL import tag. This plant pretty much similar include activity simply the principal deviation betwixt import tag as well as includes activity is that import tag tin sack include resources from the exterior world.
If you lot operate include directive or include activity you lot are solely express to include the output of resources from the same projection or or hence other spider web application residing inwards the same container.
It is the nigh powerful as well as flexible agency to include the content of i JSP to another. The file to last included is specified yesteryear url attribute of import tag.
In short
1) The principal deviation betwixt include directive as well as include activity is that the quondam is static include piece afterwards is dynamic include. Also quondam uses file attribute to specify the place of the resources to last include piece afterwards uses page attribute.
3) The fundamental deviation betwixt include activity as well as JSTL import tag is that quondam tin sack solely include local resources simply afterwards tin sack likewise include the output of remote resources, JSP pages or HTML pages exterior the spider web container. include activity uses page attribute piece import tag uses URL attribute.
That's all on the difference betwixt include direction, include activity as well as JSTL import tag inwards JSP. It's likewise an of import JSP Interview query as well as agreement these concepts volition assistance you lot to produce good inwards your side yesteryear side interview.
Further Learning
questions)
Thanks for reading this article hence far. If you lot similar this article as well as hence delight part amongst your friends as well as colleagues. If you lot accept whatever questions or feedback as well as hence delight drib a note.
0 Response to "Difference Betwixt Include Directive, Include Activeness In Addition To Jstl Import Tag Inward Jsp?"
Post a Comment