I'm not sure that the spec says to do this one way or the other, but in the
case of gnujsp, and i believe the .92 reference, a ssi just inline's the
code of your included file. gnu appears to at least do something intelligent
with import directives aggregating them to the top of your code. However, it
wont do anything for multiple bean declarations. for normal java variables
you can get around variable redeclarations by enclosing the include in it's
own scope. But if at the top of all your pages you have a <BEAN name=foo>,
or usebean, gnu puts these all at the beginning of your page and they
conflict. You can get what you want by writing your own function that loads
the servlet you need and calls service on it for you passing in your request
and response. This will in effect compile your subpage seperately run it,
and then continue to run your original page. This has the added benefit of
avoiding any naming conflicts, also you can dynamically generate the name of
the file you are including.

So here's a related question: has anyone gotten BEAN to work with a scope of
request
across included pages? if so what implementation. I noticed in gnujsp that
it checks the request to see if it's stored there, but when it creates the
bean it never sticks it in the request.

Komal


> To all,
>
> Does anyone know if an included jsp file is compiled before the jsp page
> it was called from is compiled fully?  I am looking to duplicate the
> functionality that we currently have with a product called XTags which
> allows us to use an <INCLUDE> tag which stops compilation on the current
> file, compiles the file in the <INCLUDE> tag and then returns to the
> calling file.
>
> I am looking to duplicate this functionality using JWS and JSP.  Any
> pointers or examples would be great.  I was trying to do an SSI as
> follows but I never see the output from page2.jsp....
>
> <html>
> <head>
>     <title>My First Page</title>
> </head>
> <body>
> <java>
>     out.println("What the heck is happening in here?");
> </java>
>
> <!--# include file="page2.jsp" -->
>
> </body>
> </html>
>
>
> Page 2 is as follows:
>
> <h1>My Second Page</h1>
> <ul>
>     <java>
>         for (int i = 0; i < 5; i++) out.println("<li>" + i);
>     </java>
> </ul>
>
> Any pointers of comments would be welcome.
>
> Thanks.
>
> --sean
>
> ==================================================================
> =========
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff JSP-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to