Hi:

        There are two types of includes, static and dynamic.  Keep in mind that the
jsp file essentially gets translated to a Java source file that gets
compiled to a servlet.  To include method declarations, etc, you need to
have the included file treated as though it were part of the source code of
the jsp page; this is a static include, which requires the form that looks
like:
        <%@ include file="stdprolog.jsp" %>

        The form that looks like <jsp:include file='query.jsp'/> is a dynamic
include, which gets the __output__ of the included page and includes it in
the output of your jsp.  You might use this form if you wanted to include
dynamic output from a servlet, for instance.

        So in your case, simply change to the <[EMAIL PROTECTED]> form and you'll be OK.
Be aware, however, that when Tomcat checks the page to see if the jsp source
has been updated, it only checks the jsp page, not any included files, so
when you change the included code, you need to 'touch' the jsp page, or you
won't see any changes on the output.

Best of luck.

Greg Trasuk, President
StratusCom Manufacturing Systems Inc. - We use information technology to
solve business problems on your plant floor.
http://stratuscom.ca

> -----Original Message-----
> From: Frederick Aubert [mailto:[EMAIL PROTECTED]]
> Sent: May 11, 2002 07:19
> To: Tomcat Users List
> Subject: JSP Include Directive
>
>
> Hi,
>
> According to the JSP docs on Sun website, one can use <jsp:include
> page=�/includes.txt� /> to include static content, such as
> methods that will
> be reused from different components of the webapp. I wanted to share a
> �securityCheck� method to reuse from each single places where
> security was
> required. I did place my code in a includes.txt that I tried
> to load from a
> couple of JSP pages. However even when placing the jsp
> include tag, nothing
> seems to be done since whenever I try to call securityCheck I
> get a method
> not found error... Is the include directive not supposed to
> work that way?
> How can I achieve this?
>
> Sincerely, Frederick
>
> PS: I tried to misspell the resource URL but the compiler did
> not notice
> anything...
>
>
> ---------------------------------------------------------------
>   ("`-''-/").___..--''"`-._
>    `6_ 6  )   `-.  (     ).`-.__.`)       Frederick Aubert
>    (_Y_.)'  ._   )  `._ `. ``-..-'
>  _..`--'_..-_/  /--'_.' ,'                [EMAIL PROTECTED]
> (il),-''  (li),'  ((!.-'
> ---------------------------------------------------------------
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to