Difference between include directive and include action
----------------------------------------------------------------------------------------------------------
include directive include action
------------------------------------------------------------------------------------------------------------
1. Translation Time Run time
2. Copies the included file References to the included file
3. For static content For dynamic content
4. can not pass parameters can pass parameters
--------------------------------------------------------------------------------------------------------
1. Translation Time:
Basically the page included means included your main jsp page at translation time, that means whenever your jsp translated to a servlet at that point of time even the included jsp pages content is got into the main jsp page and then it is tanslated to a servlet.
1. Run time:
It is not done at translation time so even though your servlet, eventhough your jsp translates into servlet it does not really content the included jsp content in the main page but it gets the content at run time when you execute that page
2. copies the included file:
Because it done at translation time it is simply copies all the content from your included page to main page
2. References to the included file:
Since we did not do at translation time simply keeps the included page at its own path and it has some kind of link or reference in the main page where it points to this included page and it craps this content of the included page at that run time and then populates.
3. static content:
including the translation time itself, this is more likely to use for static content, because like for example that your sub page has changed but your main has not changed and if you go and try to give this page again you wont see the latest change made in your sub page because the static content included page content was included in your main page at translation time and translation happens only once and it happens at first time and it happens whenever you changes your main page. Since you didnt make any chages in your main page, no translations happens again that means same static content present in your main page.
3. For dynamic content:
It gets the contents of the included page at run time, you can use it for dynamic content, lets say that your included page is being modified frequently, it used in lots of pages but again it is being modified frequently in that case you go for dynamic content because you dont have to really compile and change your main page so that your included page is , new content page can be reflected.
----------------------------------------------------------------------------------------------------------
include directive include action
------------------------------------------------------------------------------------------------------------
1. Translation Time Run time
2. Copies the included file References to the included file
3. For static content For dynamic content
4. can not pass parameters can pass parameters
--------------------------------------------------------------------------------------------------------
1. Translation Time:
Basically the page included means included your main jsp page at translation time, that means whenever your jsp translated to a servlet at that point of time even the included jsp pages content is got into the main jsp page and then it is tanslated to a servlet.
1. Run time:
It is not done at translation time so even though your servlet, eventhough your jsp translates into servlet it does not really content the included jsp content in the main page but it gets the content at run time when you execute that page
2. copies the included file:
Because it done at translation time it is simply copies all the content from your included page to main page
2. References to the included file:
Since we did not do at translation time simply keeps the included page at its own path and it has some kind of link or reference in the main page where it points to this included page and it craps this content of the included page at that run time and then populates.
3. static content:
including the translation time itself, this is more likely to use for static content, because like for example that your sub page has changed but your main has not changed and if you go and try to give this page again you wont see the latest change made in your sub page because the static content included page content was included in your main page at translation time and translation happens only once and it happens at first time and it happens whenever you changes your main page. Since you didnt make any chages in your main page, no translations happens again that means same static content present in your main page.
3. For dynamic content:
It gets the contents of the included page at run time, you can use it for dynamic content, lets say that your included page is being modified frequently, it used in lots of pages but again it is being modified frequently in that case you go for dynamic content because you dont have to really compile and change your main page so that your included page is , new content page can be reflected.
No comments:
Post a Comment