• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using "extends" and "jsp:usebean" tag in same JSP

 
Doug Perkins
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to extend from a class and use a JavaBean in the same JSP. When doing this I get an error indicating "the method getClassLoader... is not defined". This even happens when I import the package containing getClassLoader. This error occurs in the JSP at the jsp:useBean line.
I'm assumming it is OK to extend a class and use JavaBeans in the same JSP.
Here are my import statements for my JavaBean and the package for getClassLoader, my extends statement, and jsp:useBean line, all at the top of my JSP:
<%@ page import = "search.*" %>
<%@ page import = "java.lang.*" %>
<%@ page extends = "ibm.link2.apps.servopps.ServoppsBaseJSP" %>
<jsp:useBean id="searchHandler" class="search.SearchBean" scope="request"/>
This line of code is generated from the jsp:useBean line above, and is where the error occurs:
searchHandler = (search.SearchBean) Beans.instantiate(getClassLoader(), "search.SearchBean");
This is the exact error statement:
The method getClassLoader invoked for type ibmlink.link2.html.servopps._searchRetry_xjsp with arguments () is not defined
I have also tried importing java.lang.* into the class I'm extending from and still receive the error.
Does anyone have any ideas as to why I'm getting this error, and how to correct it?
All help is greatly appreciated. Thank you in advance.
I should also add my development environment is VisualAge For Java.
Doug
[This message has been edited by Doug Perkins (edited August 17, 2000).]
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The method Beans.instantiate takes two parameters -> Beans.instantiate(ClassLoader clsld, String name).
try to replace "getClassLoader()" with "null".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic