Hi, Can anybody explain abt page relative vs file relative. As per jsp spec 1.2 include action has page relative URL & include directive has file relative URL. They have given some sample files also. I couldnt understand. [ JSP.4.4 ] Thanks & Regards Mike
Page relative means the path of the file you want to include is relative to the current URL. File relative means the path of the file you want to include is relative to the path of the file that contains the include directive. Yeah sounds confusing doesn't it?
Joined: Jul 09, 2002
Hi Suppose for example,[ From JSP Spec ] if i have A.jsp & C.jsp & dir/B.jsp & dir/C.jsp
The Content of A.jsp is <%@ include file="B.jsp" %> The Content of B.jsp is <jsp:include page="C.jsp" />
Which file output will be included....the file which is with A.jsp or the file with dir/C.jsp Please explain relatively with page & file relative path Thanks & Regards Mike
Joined: Jun 18, 2002
Assuming we are currently viewing A.jsp in a browser. The content of A.jsp contains the include directive <%@ include file="B.jsp" %> Since include directives are file relative, the path of B.jsp is relative to the path of A.jsp, in this case B.jsp must be in the same folder as A.jsp. Now, the content of B.jsp contains the include action <jsp:include page="C.jsp" /> Since include actions are page relative, the path of C.jsp is relative to the current URL, which is the URL of A.jsp (because that's the page we are currently viewing). Therefore C.jsp must also be in the same folder as A.jsp. [ July 24, 2002: Message edited by: Tybon Wu ]