Home » beans

Tag Archives: beans

Java Servlet Bean Example

Servlets are modules of the Java code that run in a server application to answer the client requests. In this tutorial, we will explain how to handle the JavaBean in a Servlet. 1. Introduction Servlet is a Java program which exists and executes in the J2EE servers and is used to receive the HTTP protocol request, process it and send ...

Read More »

JSF Managed Beans Example

In this example we will talk about the basics of the JSF Standard and the Managed Bean concept. With these tools we can develop and support an application’s clear architecture, and get an easily integration with java EE modern technologies. Then, we learn how to work with the backend, using JSF Managed Beans.               ...

Read More »

Bean XML deserialization

Bipartite Graph

With this example we are going to demonstrate how to deserialize a java Bean using the XMLDecoder. The XMLDecoder class is used to read XML documents created using the XMLEncoder and is used just like the ObjectInputStream. In short, to deserialize a java Bean using the XMLDecoder you should: Create an xml representation of the java bean. Create a simple ...

Read More »

Bean XML serialization

Bipartite Graph

This is an example of how to serialize a java Bean using the XMLEncoder. The XMLEncoder class is a complementary alternative to the ObjectOutputStream and can used to generate a textual representation of a JavaBean in the same way that the ObjectOutputStream can be used to create binary representation of Serializable objects. Serializing a java Bean using the XMLEncoder implies ...

Read More »

Bean property change event listener

Bipartite Graph

In this example we shall show you how to change a Bean’s property using an event listener. We will use the PropertyChangeListener interface. This interface can be registered with a bean so as to be notified of any bound property updates. We are also using the PropertyChangeSupport class. This is a utility class that can be used by beans that ...

Read More »

List bean property names

Bipartite Graph

With this example we are going to demonstrate how to list the names of a bean’s properties. We are using the PropertyDescriptor, a class that describes one property that a Java Bean exports via a pair of accessor methods. We are also using the Introspector class, that provides a standard way for tools to learn about the properties, events, and ...

Read More »

Get/Set a bean property

Bipartite Graph

This is an example of how to get and set a bean property. We are using the Statement class. A Statement object represents a primitive statement in which a single method is applied to a target and a set of arguments. In order to get and set a bean property you should: Create a simple class, like Bean class in ...

Read More »