JSF 地図ビューを追加するには、以下の手順に従います。
-
WebContent フォルダーにある新しい index.jsp ファイルを開き、 以下のコード例で太字で示されているコードを追加します。
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%> <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%> <%@ taglib uri="http://www.ilog.com/jviews/tlds/jviews-maps-faces.tld" prefix="jvmf"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> <f:view> <h:form id='jviewsForm'> <jvmf:mapView id='mapID' width='1280' height='800' data='/world.idpr'/> </h:form> </f:view> </body> </html>
<jvmf:mapView>
コンポーネントにより、 JViews Maps で作成された地図を表示することができます。このコンポーネントのdata
属性は、JViews Maps プロジェクト・ファイルを参照します。<jvmf:mapView>
を<h:form>
コンポーネント内に挿入する必要があることにも注意してください。
これで、JViews Maps JSF アプリケーションのコーディングは完了しました。
次に、アプリケーションを配布およびテストすることができます。