wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes page relative vs file relative [ include action vs include directive] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "page relative vs file relative [ include action vs include directive]" Watch "page relative vs file relative [ include action vs include directive]" New topic
Author

page relative vs file relative [ include action vs include directive]

Raj Paul
Ranch Hand

Joined: Jul 09, 2002
Posts: 77
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
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
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
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
Cool...
Thanks & Regards
Mike
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: page relative vs file relative [ include action vs include directive]