JSP页面中调用JAVABEAN,出现了对象为空的问题
C:\Tomcat41\work\Standalone\localhost\_\admin_add_jsp.java:49: <identifier> expected
class.adminBean ADMIN = null;
^
An error occurred at line: 6 in the jsp file: /admin_add.jsp
Generated servlet error:
C:\Tomcat41\work\Standalone\localhost\_\admin_add_jsp.java:49: '{ ' expected
class.adminBean ADMIN = null;
^
An error occurred at line: 6 in the jsp file: /admin_add.jsp
Generated servlet error:
C:\Tomcat41\work\Standalone\localhost\_\admin_add_jsp.java:50: illegal start of type
synchronized (request) {
=================================================
上面是出现的问题,其中:class 是包名,adminBean 是被调用的类,而 ADMIN 是在JSP页面中调用类的时候定义的ID,出现以上问题,不知何故?
------解决方案--------------------adminBean 中的 ADMIN属性为空,看看有没有初始化过
------解决方案--------------------ADMIN 這個對象沒有初始化!!
class.adminBean ADMIN =new class.adminBean(參數...)