Yes, you can declare static variables by placing them in a <%! %> construct, which creates class-level declarations. Be careful doing so, as accidentally creating class-level read/write instance variables in such a construct can introduce thread-safety issues into your JSPs.
In fact, at this stage of the game, unless you are stuck in a pre-JSP 2.0 world,
you should be migrating
away from using any scriptlet constructs in your pages at all in favor of the JSTL and EL.
[ August 21, 2006: Message edited by: Bear Bibeault ]