The moose likes Servlets and the fly likes How can i use Beans? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How can i use Beans?" Watch "How can i use Beans?" New topic
Author

How can i use Beans?

Shahid Ali Naz
Greenhorn

Joined: Mar 23, 2001
Posts: 3
hi
con some body tell me about using beans like how to create beans compile and use for
example my task is implement a bean which give me the length of String
code is
public int len(String str)
{
return str.length();
}
how can i use on jsp or java programmes can u write bean on simple editor like java files and how can i complie and how i call from my main application
bye


S.A Naz
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
First of all, your class does not look like an information bean with its method len. It should be getLen(String s) or getLength(String s)
Yes you can use a simple editor to write a Java bean. A Java bean is nothing more than a class with methods that follow some kind of convention in naming.
I am assuming that you mean Java beans in the server-side context and not in the visual context which requires considerably more programming.
Information on how to write beans is freely available from Sun at:
http://java.sun.com/docs/books/tutorial/javabeans/index.html

Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can i use Beans?