I've got a JSP page and a JavaBean (.CLASS file) in the same directory on
the webserver but I'm getting an error when I try to run the JSP page.
Here is the JSP page:
<%@ page import = "MyTestBean" %>
<jsp:useBean id="mybean" class="MyTestBean" scope="session" />
<html>
Here is the output from my bean: <b> <%= mybean.printMessage() %> </b>
</html>
Here is the JavaBean code:
public class MyTestBean
{
public MyTestBean()
{
}
public String printMessage()
{
return "Hello World.";
}
}
Here is the error message I get from JRun:
500 Internal Server Error
com.livesoftware.jsp.JSPServlet:
javax.servlet.ServletException:
Found 2 semantic errors compiling
"C:/JRun/jsm-default/services/jse/servlets/jsp/jpatterson/mybeantest.java":
17. import MyTestBean;
<-------->
*** Error: "MyTestBean" is either a misplaced package name or a non-existent
entity.
37. MyTestBean mybean = (MyTestBean)
JSPRuntime.instantiateBean("mybean", "MyTestBean", "session",
__mybean_was_created, pageContext, request, session, application);
<-------->
*** Error: Type jsp/jpatterson/MyTestBean was not found
WHAT AM I DOING WRONG???
Thanks,
Jeff
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html