Two Laptop Bag*
The moose likes JSP and the fly likes What are include files in jsp? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "What are include files in jsp?" Watch "What are include files in jsp?" New topic
Author

What are include files in jsp?

ernest fakudze
Ranch Hand

Joined: Aug 27, 2001
Posts: 216
I have seen some jsp code which include a .inc file like
<%@ include file ="xxx.inc" %>
What are include files?


In a time of drastic change it is the learners who inherit the future. The learned usually find themselves equipped to live in a world that no longer exists.<br />Eric Hoffer
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
The "Include" directive is used to include output from other sources such as HTML, JSP, etc. during page translation time, into the output of your JSP page. A Typical example is web sites that have the same header/footer on all pages. Instead of having the same HTML on all pages, that common information can be extracted into a file and then "included" in the resulting JSP at translation time.

------------------
Bosun
SCJP for the Java� 2 Platform


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
ernest fakudze
Ranch Hand

Joined: Aug 27, 2001
Posts: 216
Thanks Bosun but here is my real problem: with the include directive a programmer can either include .jsp, .html and .inc files types. Now I know what jsp and html files are but what type of a file is an inc file e.g. fileName.inc. Does it get translated, compiled or anything else? Could we convert a .inc file to a jsp without any problems.
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Whatever file you include using <%@include %> becomes part of the .jsp itself. And the .jsp is translated. The type of the included file is completely irrelevant.
- Peter
ernest fakudze
Ranch Hand

Joined: Aug 27, 2001
Posts: 216
Thanks guys for clarifying that one to me. Really appreciate it.
 
 
subject: What are include files in jsp?