Originally posted by Bear Bibeault:
No. Not any more than you could use a variable delared in a method of one Java class in another Java class.
Originally posted by Bear Bibeault:
What you describe can in no way be considered sharing the variable across JSPs. The included file, whose conventional suffix should be .jspf rather than .jsp, is not a separate JSP, but a fragment that becomes part of the main JSP.
That's like saying you can share a variable across C modules by using the #include directive.
Originally posted by Heonkoo Lee:
I was just giving an example that you can declare a variable in one jsp and use it in another jsp
Originally posted by Bear Bibeault:
My point is that you did not give an example of using a variable in more than one JSP. When you perform a static include there is only one JSP. So there's nothing else to share with,
Just because you erroneously called the included fragment a JSP doesn't make it one.
[ February 24, 2006: Message edited by: Bear Bibeault ]
Originally posted by Bear Bibeault:
You could possibly be confusing people, especially beginners, if you keep insisting that the fragment included via a directive is a JSP file. It is not. A JSP file must be a syntactically complete unit. For example, it you were to include a page via the include action (as opposed to the directive), the referenced page must be a complete and syntactically correct JSP page. When using the include directive, the included file does not need to be a syntactically correct JSP page.
So calling the included file a JSP is incorrect and misleading. It's just a file with a fragment of text in it that becomes part of a JSP.