difference between include directive include action tag jsp

By: pushpendra.abesit@gmail.com On: Sun Dec 29 15:19:43 IST 2013     -3 0 0  -3


<% out.println("Hello Directive");%>


<%@ include file="demo.jsp" %>
<%="Example of include directive" %>

it is example of include directive.in this example if we make any change in he called jsp(here demo.jsp)then calling jsp(here include.jsp) gets update every time automatically while it should not be happen but here it is happening.if it happens then what is the difference between include directive & include action.please give proper explanation...


<%@ include file=?filename? %> is the JSP include directive.
At JSP page translation time, the content of the file given in the include directive is ?pasted? as it is, in the place where the JSP include directive is used. Then the source JSP page is converted into a java servlet class. The included file can be a static resource or a JSP page. Generally JSP include directive is used to include header banners and footers.

The JSP compilation procedure is that, the source JSP page gets compiled only if that page has changed. If there is a change in the included JSP file, the source JSP file will not be compiled and therefore the modification will not get reflected in the output.
<jsp:include page=?relativeURL? /> is the JSP include action element.
The jsp:include action element is like a function call. At runtime, the included file will be ?executed? and the result content will be included with the soure JSP page. When the included JSP page is called, both the request and response objects are passed as parameters.

If there is a need to pass additional parameters, then jsp:param element can be used. If the resource is static, its content is inserted into the calling JSP file, since there is no processing needed.

By: kumarrajat557@gmail.com On: Mon Dec 30 10:43:06 IST 2013 0 425 0 425
Are You Satisfied :3Yes0No


include directive inserts the source at translation time but the action tag inserts the response at runtime.

and there is an extra performance hit with every action tag.

By: malikravi908@gmail.com On: Mon Dec 30 18:21:32 IST 2013 0 419 0 419
Are You Satisfied :0Yes0No

you are right sir,but in my example given above if i make any changes in the included jsp page(here demo.jsp) then it reflects the changes which i have made in the included jsp page automatically while the changes in the included jsp page should not be reflected in the source jsp page but in this example source jsp page reflect the changes which i have made in the included jsp page.now my question is that why it reflects the changes of included jsp page in the source jsp page aumatically when i make any changes in included jsp page.0

By: pushpendra.abesit@gmail.com On: Tue Dec 31 01:07:34 IST 2013 -3 0 0 -3
Are You Satisfied :0Yes0No


Please login first to post reply. login