Does the bean in jsp have to be in the same folder with it or in subfolder?
For ex: <jsp:useBean id="firstBean" scope="request"
class="beans.project1.firstBean" >
My jsp page in in folder jsp\ , so does the beans need to be in that folder
too?  If it is in different folder, how the server knows where it located?

                -----Original Message-----
                From:   Craig R. McClanahan
[mailto:[EMAIL PROTECTED]]
                Sent:   Wednesday, December 29, 1999 10:48 AM
                To:     [EMAIL PROTECTED]
                Subject:        Re: <BEAN> in JSP

                David Mossakowski wrote:

                > Yes you can call *any* class and use it's methods with
                > jsp:usebean tag.  Beans are just classes.  But that is not
                > always recommended plus it can lead to problems later on
if
                > you use things like a hashtable as the bean itself.  It's
                > always better to encapsulate that hashtable in some object
                > of your own whose name will be more meaningful.
                >
                > dave.
                >

                There are two conventions in the JavaBeans spec (highly
recommended reading!) that are important
                to classes you use as beans in JSP pages:

                * If you want the JSP page to create an instance of your
                  bean if it is not there already, you must provide a
                  no-arguments constructor.  If your bean is created
                  some other way (such as in a servlet) this does not
                  matter.

                * The <jsp:getProperty> and <jsp:setProperty> calls will
                  only work if your method names follow the standard
                  naming conventions for property getters and setters.

                Craig McClanahan


===========================================================================
                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

===========================================================================
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

Reply via email to