skip to main content
Programmers documentation > Building Web applications > The network view JavaServer Faces component > Declaring a network view JSF component
 
Declaring a network view JSF component
The network view JSF component displays the contents of an IlpNetwork in a JavaServer™ Page (JSP™) compliant with the JavaServer™ Faces (JSF) technology. It is implemented by the class IltFacesNetworkView and acts as a facade to an IlpNetwork component. It provides a convenient API for the most common uses of the network component, such as setting or retrieving the associated data source, accessing the underlying network component, or accessing the network view directly.
JViews TGO JSF components are declared in a tag library descriptor ( .tld ) file named jviews-tgo-faces.tld that is included in the jviews-tgo-all.jar. The JViews TGO JSF tag library must be declared in the JSP page before any of its components are used.
How to define the JViews TGO JSF tag library and prefix in a JSP page
The declaration is done at the beginning of the JSP file as follows:
 
<%@ taglib uri="http://www.ilog.com/jviews/tlds/jviews-tgo-faces.tld"
prefix="jvtf" %>
This statement declares the jviews-tgo-faces.tld tag library within a JSP page, and binds all its components to the jvtf prefix. Once this is done, you can declare the network view component as follows:
How to declare a network view JSF component
 
<jvtf:networkView id="myNetwork"
                    context="#{myContext}"
The networkView component requires two mandatory tag attributes:
*id (component unique identifier): Can be any given string that uniquely identifies this component within a server session.
*context (the IlpContext to be used): Must be a value binding to an instance of IlpContext declared as a managed bean.
For Web applications, the TGO context must be ilog.tgo.faces.service.IltFacesDefaultContext or a user defined subclass.
If you have started the bundled Tomcat web server, the following link will take you to the small sample illustrating this: http://localhost:8080/jsf-network-step-by-step/faces/example1.jsp.
You will find more information about the sample web application in <installdir> /samples/faces/jsf-network-step-by-step/index.html where <installdir> stands for the directory where Rogue Wave JViews TGO is installed.

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.