Web components and your application

You can create and print web components in a servlet or JSP.

A web component is an instance of the IlxWComponent class. This class is designed to be deployed in a servlet or a JSP. It uses the method print to print its graphic representation to the designated port.

A port, which is an instance of the class IlxWPort, can be considered as a stream for displaying the HTML code representing the component on a web browser. This port encapsulates the response writer of a servlet.

Before printing a component to the port, component deployers must call the method open. When they have printed all components to the port, the component deployers must then call close.

All components are associated with a manager, an instance of the class IlxWManager. You can consider a manager as a container of component objects. You always have one instance of IlxWManager associated with the current session.

A session is an instance of the class javax.servlet.http.HttpSession. Each user is associated with a session. You can always retrieve the current session manager by calling the static method getManager.

You can display a web component by calling the doGet or doPost methods of a servlet.

You can also deploy web components in JSP (JavaServer Pages). The code is similar to that of the servlet integration. The only difference is that to create a port in JSP, you must pass the page variable out as an argument, while in a servlet you call the method response.getWriter.