第一个问题答案如下,不过这样不好,因为jsp一般与javabean结合使用
class a{
void test(){
System.out.println("aa");
}
}
a b = new a();
b.test();
第二个问题嘛,自己看着办