"Craig R. McClanahan" wrote:
>
> Well, any given page creates only one instance of the servlet class, so using
> static really would not make any difference here. The string constants are (in
> effect) created when the class is first loaded, not on every method call. Also,
> most JVMs implement String constants in a manner that they are shared across
> classes and instances anyway, although there are no guarantees here.
A VM has to share all String literals globally, so that given:
class C1 {
static final String s = "xxx";
}
class C2 {
static final String s = "xxx";
}
it will be true that C1.s == C2.s. The java language spec
section 3.10.5 requires this.
http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html
Some 1.1 VMs have a bug where its string literal table will
overflow & crash, but that's a different story.
-dave brown
>
> But people who want to work on improving the quality of the code generated by
> Jasper are quite welcome -- in the Tomcat 4.1 time frame, I would like to see a
> lot of attention on this particular area.
>
> Craig