Please help,
Have installed Tomcat 3.2.1 successfully on W2K and all examples
work fine. JSPs and servlets that we create also are hunky
dory.
The problem - beans do not work for me.
I reference the bean in the JSP in the usual way (have tried
it with and without the import):
<%@ page import =
"icegroup.beans.MyBean" %>
<jsp:usebean id="mytestbean"
class="icegroup.beans.MyBean"/>
<jsp:getProperty name="mytestbean"
property="mystring"/>
The error that results when I run the JSP is:
org.apache.jasper.JasperException: Attempted a bean
operation on a null object.
I have the bean class in my WEB-INF\classes directory (have also
tried it in WEB-INF\classes\icegroup\beans). Have also
tried
setting the CLASSPATH directly to the class folder in the
Tomcat
startup script. ( The bean code is shown below for
completeness. )
I have been digging into docs and forums for a couple of days
on this one so your ideas and help are greatly appreciated.
Thanks,
Rick Palmer
IceGroup, Inc.
...................................................................................
package icegroup.beans;
public class MyBean implements java.io.Serializable
{
private int myint;
private String mystring;
public MyBean()
{
myint = 1;
mystring = "MyBean Generated
String";
}
public int getMyint()
{ return myint; }
public void setMyint(int i)
{ myint = i; }
public String getMystring()
{ return mystring; }
public void setMystring(String s)
{ mystring = s; }
}
- Re: Beans with Tomcat 3.2.1 Rick Palmer
- Re: Beans with Tomcat 3.2.1 Nick Christopher
- RE: Beans with Tomcat 3.2.1 Wong, Connie
- RE: Beans with Tomcat 3.2.1 Huiyuan Ma
- RE: Beans with Tomcat 3.2.1 Wong, Connie
- RE: Beans with Tomcat 3.2.1 Mark Johnson