Either syntax should work. The syntax I normally use is:
<jsp:useBean class="FooBean" id="foo" scope="session">
</jsp:useBean>
However, the other syntax will also work:
<jsp:useBean class="FooBean" id="foo" scope="session" />
As far as the set and get property tags, put them between
the useBean tags if you want them to execute only when the
bean is first instantiated. If the bean is reused, either
on that page or another one, any set or get property tags
will be ignored. For good general info on useBean, go to:
http://developer.java.sun.com/developer/onlineTraining/JSPIntro/contents.html#JSPIntro11 It's hard to be sure what's causing your error without seeing
the line of code it referenced. My guess it that you have a
declaration statement without a semi-colon at the end:
<%! int i=0 %> instead of <%! int i=0; %>
--Brett.