page relative vs file relative [ include action vs include directive]
Raj Paul
Ranch Hand
Joined: Jul 09, 2002
Posts: 77
posted
0
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
Tybon Wu
Ranch Hand
Joined: Jun 18, 2002
Posts: 84
posted
0
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?
SCJP2
Raj Paul
Ranch Hand
Joined: Jul 09, 2002
Posts: 77
posted
0
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
Tybon Wu
Ranch Hand
Joined: Jun 18, 2002
Posts: 84
posted
0
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 ]
Raj Paul
Ranch Hand
Joined: Jul 09, 2002
Posts: 77
posted
0
Cool... Thanks & Regards Mike
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: page relative vs file relative [ include action vs include directive]