A bean is a class but a class isn't necessarily a bean.
There are certain things bean must do and certain things a bean must implement in
order to be called a bean but really it's just a class and behaves the same way as
class. Check out sun's site for more specifics.
I'm not going to code for you a class that has one variable in it (check out some
great books on this subject).
In order to use a class/bean that you have written you have to put it in a
directory that's in the classpath of your servlet engine. Then you have to give it
a name(id) that it will be known as in the JSP page:
<jsp:useBean id="clientEntry" class="com.instinet.crossroads.console.ClientEntry"
scope="session"/>
then use the id to get the class' properties:
<%= clientEntry.getName() %>
OR (i think)
<jsp:getProperty name="clientEntry" property="name"/>
OR (surely)
<%= clientEntry.getName() %>
dave.
Rick L Sample wrote:
> I have been reading the docs and examples that come with JavaWebServer2.0
> but I am getting confused with how to use a CLASS/Bean from a JSP page.
> And where to put them.
>
> Here is what I want: (Very simple examples please)
>
> A JSP that uses a CLASS. In that class, just an initial value X,
> then simply add 1 to x to display both on the page.
> Then, the same for a bean.
>
> TIA!
>
> ===========================================================================
> 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
--
David Mossakowski [EMAIL PROTECTED]
Programmer 212.310.7275
Instinet Corporation
"I don't sit idly by, I'm planning a big surprise"
===========================================================================
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