For your class to be a JavaBean (in the JSP world, not in general) it needs
to have a no-args constructor so that it can be instantianted by the jsp
engine, such as

public MyBean() {
// do whatever
}

If you want to use JSP's getProperty & setProperty tags you need to have
associated mutator methods in the bean, such as:

public void setFoo(String foo) {
  this.foo = foo;
}

public String getFoo() {
  return foo;
}

where 'foo' is the name of the property.

Scott Evans
SI&I Training Development
46833 (Ramat Gan)



> -----Original Message-----
> From: Pete Walsh [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 17, 2000 4:55 PM
> To: [EMAIL PROTECTED]
> Subject: JavaBeans Compile?
>
>
> Ok I am starting to use JavaBeans with JSP pages.  I've never
> made a 'bean'
> before and I was wondering how to do it.  When I try to
> recompile the code
> to a bean I dont get errors (using normal javac 'filename')
> but when the jsp
> pages comes up it has errors.  The code isnt messed up
> because I am using
> the code for an example that works.  Is compiling a bean
> different than
> compiling normal Java code?
>
> Also do I need Java Enterprise Edition SDK 1.2.1?  I have the Standard
> Edition SDK 1.3.  (When I tried to install the J2EE it didnt
> have javac in
> it and I was all confused)  Please explain if this is the
> reason.  I just
> started programming in java and don't know the basics.  Thanks.
>
> Thanks
>
> Pete
>
> ==============================================================
> =============
> To unsubscribe: mailto [EMAIL PROTECTED] with body:
> "signoff JSP-INTEREST".
> 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

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
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

Reply via email to