On Wed, 2 Aug 2000, Robin Green wrote: > Donald Ball wrote: > >xsp:logic elements outside of your root element are treated as class > >variables - they don't appear in a method. it's like writing: > > > >public class test { > > > > static private int counter = 0; > > String id = request.getParameter("id"); > > > >} > > > >even if request was in scope at the time, it's forbidden for statements to > >appear outside of a method or static initializer block. > > Er, I have to be pedantic here. The rest of what you said is right, of > course, but... although class test wouldn't compile because the request > object isn't declared, if you did declare it: > > public class test { > > static private int counter = 0; > HttpServletRequest request = new DummyRequest (); > String id = request.getParameter("id"); > > } > > then it could compile. String id = request.getParameter (id) is a perfectly > valid package-private declaration. Also, statements can appear in instance > initializers (methods with no header at all, like this {x=y;} ), not just > methods or static initializers. god, you're so right, i was very sleepy when i wrote that. must remember - don't give advice late at night anymore. - donald