"Jay H. Lang" wrote:
>
> I have created a simple Java Bean, and a JSP that uses this bean. I am
> getting
> an error when using the bean and I cannot figure it out. I have
> included the JSP, the Bean and the error.
There are two problems:
> <jsp:useBean id="myBean" class="JayBean" scope="request">
> </jsp:useBean>
You need to either add page directive that imports the bean:
<%@ page import="JayBean" %>
or make the bean part of a package:
<jsp:useBean id="myBean" class="com.mycomp.JayBean" scope="request" />
I explain why this is so in an article published on the O'Reilly site:
<http://java.oreilly.com/news/jsptips_1100.html>
> <H1> My Name is: <jsp:getProperty name="myBean" property="FirstName" />
> </H1>
Bean property names are case sensitive and should start with a lower
case letter (see the bean spec for exceptions). So the <jsp:getProperty>
element must look like this:
<jsp:getProperty name="myBean" property="firstName" />
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets