Conclusion
Case1:
2. <jsp:include page= http://localhost : 8080/jspl/second.jsp />
3. <%@ include file= http://localhost : 8080/jspl/second.jsp />
The value of file and page attribute should be Relative path only, we are not allow to provide complete URL which includes host name, server port etc. These standard actions are designed to work within the web applications. i.e. outside the web application communication purpose we can’t use these tags.
Case 2:
1. <jsp:forward page= “/test”/>
2. <jsp:include page= “/test”/>
3. <%@ include file= “/test”/>
In the case of forward & include page attributes are pointing to servlet. But in the case of include directive file attribute can’t pointing to a servlet. It can point to any Jsp (or) html (or) xml or xhtml etc.
Case 3:
1. <jsp:forward page= “second.jsp?c1=scjp”/>
2. <jsp: include page= “second.jsp?c1=scjp”/>
3. <%@ include file= “second.jsp?c1=scjp”/>
First and second are valid third is invalid. In the case of forward and include action we are allow to pass query string but in the case of include directive we can’t pass query string.
No comments:
Post a Comment