Perforce JViews Maps Code Example: JavaServer Faces Maps components
Description
These examples show how to use the Perforce JavaServer Faces components in order to display a map and interact with it.
Installing the Thin-Client Code Example
The code example contains a WAR file (Web Archive) that allows you to easily install the code example on any server that supports the Servlet API 2.1 or later. For your convenience, the WAR will be copied to the Tomcat web server that is supplied with the Perforce JViews installation when you start the server using the supplied scripts. Tomcat is the official reference implementation of the Servlet and JSP specifications. If you are already using an up-to-date Web or application server, there is a good chance that it already has everything you need. The sample can also be deployed to WebSphere Application Server (WAS).
Running the Code Example Using Tomcat
If you intend to use the Tomcat Web server provided with this
installation, follow these instructions to start the server:
Running the Server-Side Samples.
The scripts to start the server can be found in the
tools/tomcat-jsf directory.
Note: if you are running on Windows then you will find menu items in
the Windows "start" menu to start and stop the Tomcat server.
Once the server is running, you can see the code example by opening the following page:
- Perforce JViews Maps Code Example: JavaServer Faces Maps components
http://localhost:8080/jsf-maps-code-fragments
Running the Code Example Using WebSphere Application Server
In addition to the instructions provided for using Tomcat, the samples can be
viewed on WebSphere Application Server. Follow the instructions:
Running the Server-Side Samples
and use the scripts to start the server and deploy the sample.
Once the server is running, you can see the code example
by opening the following page:
http://localhost:9443/jsf-maps-code-fragments
The WAS administrative console can be used to verify or modify server settings:
http://localhost:9043/ibm/console/
Note: the WAS server can start on a range of port numbers, therefore the value
is not guaranteed to remain the same.
The scripts provided with the samples can be used to obtain the port numbers used
by the Admin Console
and by the deployed Web applications.
To retrieve a list of all the WAS port numbers, run the command line instruction:
ant -f build_was.xml ws.list.ports
Topics Covered
- JavaServer Faces
- Thin client
- User Manual
Detailed Description
This page groups several code fragments and each code fragment is a JavaServer Page (JSP).
A brief description of the code fragment is present in the JSP page.
All code fragments for JViews Diagrammer JavaServer Faces components are valid with JViews Maps components; you just
need to replace the diagrammerView
tag with a mapView
tag.
Installation Directory
The JavaServer Faces Maps components code example is installed here.
Classes Involved
- ilog.views.maps.faces.component.IlvFacesLayerVisibilityTool
- ilog.views.maps.faces.dhtml.component.IlvFacesDHTMLMapView
- ilog.views.maps.faces.dhtml.component.IlvFacesGoogleViewComponent
Source Files
-
code_fragment1
This JSP page shows how to display a map created with the Map Builder.
-
code_fragment2
This JSP page shows how to connect a Layer Visibility control to the Map View.
-
code_fragment3
This JSP page shows how to use the Google Maps View.
-
code_fragment4
This JSP page shows how to use the Google Maps View with a Layer Visibility control and a diagram.
-
code_fragment5
This JSP page shows how to use JViews Maps in a Trinidad environment.
-
WEB-INF/faces-config
This configuration file shows how to set up Trinidad rendering for JSF.