I am trying to use a JavaBean in a JSP, but I am getting some funky error messages. I am trying to implement the "Hello" bean example written about in the Java Servlet Programming (version 2) book, but it doesn't seem to want to work.
I have my JavaBean compiled without any problems, and the class file is located in my WEB-INF file. My JSP is trying to bring it in, but there are error messages.
Here is what my JSP source looks like:
<[EMAIL PROTECTED] import="HelloBean" contentType="text/html"%> <html> <head><title>JSP Page</title></head> <body>
<jsp:useBean id="hello" class="HelloBean"> <jsp:setProperty name="hello" property="*" /> </jsp:useBean>
<jsp:getProperty name="hello" property="name" />
</body> </html>
And the error messages I am getting (when I try to compile the project with NetBeans)...
index$jsp.java [3:1] '.' expected
import HelloBean;
^
index$jsp.java [65:1] cannot resolve symbol
symbol : class HelloBean
location: class org.apache.jsp.index$jsp
HelloBean hello = null;
^
index$jsp.java [68:1] cannot resolve symbol
symbol : class HelloBean
location: class org.apache.jsp.index$jsp
hello= (HelloBean)
^
index$jsp.java [73:1] cannot resolve symbol
symbol : class HelloBean
location: class org.apache.jsp.index$jsp
hello = (HelloBean)
java.beans.Beans.instantiate(this.getClass().getClassLoader(),
"HelloBean");
^
index$jsp.java [104:1] cannot resolve symbol
symbol : class HelloBean
location: class org.apache.jsp.index$jspout.print(JspRuntimeLibrary.toString((((HelloBean)pageContext.findAttrib
ute("hello")).getName())));
^
5 errors
Errors compiling index.---
I am getting these errors on both the PC and Mac platforms, both using NetBeans. I can't seem to figure this one out. What am I missing?? Thanks for your help with this frustrating problem!
Regards, Andy
___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
