[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index] [Home]

Re: How do you write a quick bean for JSP servlets??


---Keith Kwiatek <kkwiatek@nist.gov> wrote:
>
> 
> Hello,
> 
> I am just starting up with GNUJSP, and want to get some simple
> "soup-to-nuts" examples (template, servlet, bean code) of a
javaservlet that
> uses JDBC and the GNUJSP for HTML display....
> 
> In particular, I want to see the java bean code that is used to
interface
> between the servlet and JSP template....Can anyone provide insight
on how to
> write a quick bean to accomplish the servlet -> JSP template
> interaction? ---OR do I need to jump into complicated bean development
> books?
> 
> Keith
> 
> 

It is not so complicated.  A bean is nothing more than a class that
implements java.io.Serializable.  Methods to access properties should
table the form of

public void setNameOfProperty(datatype value)
public datatype getNameOfProperty

Finally, to instantiate a bean use the instantiate method in the
java.beans.Beans class.



 
==
Karl Ostendorf
karl@ostendorf.com


_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com