Hi I am trying to figure out how to properly import a class in a
JSP.
The DocumentRoot directory is set in Websphere and that is where my JSP's reside. I have created a folder off of the DocumentRoot directory called classes and placed my .class file in there. I then set the classes directory in the classpath (and restarted the appserver)
I have an import statement in my jsp for the class.
I am now getting an error that says it is unable to compile because of null. Any ideas???
Below is a
test piece of JSP code and the class code:
------------------------------------------------------
<%@ page import="java.io.*, java.util.*, java.text.*, IPRStat, java.net.*,java.sql.*"%>
<HTML>
<BODY>
<%
try {
String IPRNum = "001-0001";
String IPRStatus = "OK";
IPRStat Testing = new IPRStat(IPRNum, IPRStatus);
} catch (Exception e) {
out.println("Error detected " + e.getMessage());
}
%>
</BODY>
</HTML>
----------------------------------------------------
class IPRStat
{
public IPRStat(String i, String d )
{
iprnum = i;
status = d;
}
public String getIPRNum()
{
return iprnum;
}
public String getStatus()
{
return status;
}
private String iprnum;
private String status;
}
-----------------------------------------------------