MollyPages.org
"You were wrong case. To live here is to live." |
Pages /
Database /
Forms /
Servlet /
Javadocs
/
License & Download /
Tutorials /
Cookbook
/
Contact & Hire
|
[! .. !]
delimiters used to mark declarations within
the page; instead the external file should just simple define
methods/variables.
External declaration includes are useful when the same methods or variables need to be used by more than one page. These common methods can be abstracted out to an external file and then included by as many pages as needed.
If the file to be included is later modified (but the page itself is unchanged
and hence not recompiled), the updated included file will not be seen in the
page. The page should be updated or touch
'ed
to force it to recompile and hence load the included file again.
If the included file name is absolute (begins with a '/'), then it is relative to the servlet webapp, otherwiser it is relative to the current page.
[include-decl filename]Quotes around the filename are optional.
It makes no difference where the include is located textually in the page, since all declarations are methods/variables in the generated page class (and the order of method declaration makes no difference in Java).
In this example, the external declaration file (common.methods) contains the following lines:
String greeting() { return "Hello world"; }