You don't need to (and can't) declare a class inside a JSP.
The container you're using will convert your JSP into a
Java Servlet class for you.
If you have no experience in Java, I recommend following a few tutorials before delving into servlets and JSP.
The "First Cup Of Java" tutorial on
http://java.sun.com is very good.
Once you've done that, take a look at
http://pdf.coreservlets.com. It's a great book and can be download for free in PDF form.
There is also a second edition to the book that is more current (you'll have to buy that one).
On the surface, JSP looks a lot like ASP or PHP but there are some very important differences that can get you into trouble if you don't understand them. Threading, is number one.
Learning servlets first, makes the underlying concepts behind JSP much easier to understand.
[ June 29, 2005: Message edited by: Ben Souther ]