你肯定想不到我居然整整3*7小时的时间才建成自己的第一个ArcServer for java工程,用Eclipse生成一个模板很简单,但自己就想从一个web工程开始自己建立一个工程,最简单,就要一个mapcontrol就可以,折腾了三天,算是对jsf有些了解,但损失的时间是大了些,但没有资料说这些,就慢慢折腾了,好下面我就总结一下:
流程:发布服务+建立页面+配置XML+建立一些文件+类库
(1)发布地图服务,这个容易,就不说了,但是发现Arcserver发布的服务很是不稳定,一会就连不上了,很是不好用。
(2)建立页面:index。html+map。jsp
index.html就用自动生成例子里的,粘贴过来就好,
map.jsp就用Developer help里的例子
(3)配置文件,这是最麻烦的东西了,但老重要了,
web.xml,这里已经是最简单的了,不要尝试那个能删掉,我已经试过了,具体代表什么意思,有的知道,有的不知道了,你可以看看
http://warrenwyf.spaces.live.com/?_c11_BlogPart_pagedir=Next&_c11_BlogPart_handle=cns!C71882196B68EEE5!628&_c11_BlogPart_BlogPart=blogview&_c=BlogPart这个,权威!
faces-config.xml,这个里的都明白,就是配置数据了,但还是有一条,就是mapContext。webMap,这个webMap是哪的东西啊,是context-attribs里的吗?但它里面没有webMap这个变量只有这个类啊?
context-attributes。xml,干什么用的 ,好像就是说地图用一个Png图片显示了
ajax-renderers。xml,就是一个简单的地图,你移动它就要用到这个配置文件,主要是实现ajax的,没有肯定不行了。
ags-functionalities。xml,这个就是在faces-config。xml里定义的那些functionalities。还有好几个类似文件,直接拷贝进来就好了。
(4)js文件夹,拷贝进来,images,自己定义也可以,src下加入res和xsl,必须的。
奇怪的一个就是必须有MapViewerPhaseListener。java,好像是为了实现地图拖动吧,但在什么时候调用,我还没找到。
(5)类库,直接拷贝就好了。
这里面多了帮助里没有提到的东西,所以自己按着帮助就连第一个例子就建不起来,就采用删减生成的例子来达到目的了。
流程:发布服务+建立页面+配置XML+建立一些文件+类库
(1)发布地图服务,这个容易,就不说了,但是发现Arcserver发布的服务很是不稳定,一会就连不上了,很是不好用。
(2)建立页面:index。html+map。jsp
index.html就用自动生成例子里的,粘贴过来就好,
map.jsp就用Developer help里的例子
Code
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ArcGIS</title>
<link rel="stylesheet" title="base" href="css/base-style.css" type="text/css" media="screen" />
<style type="text/css">
body { overflow:auto; }
</style>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" language="Javascript" src="js/esri_core.js"></script>
<script type="text/javascript" language="Javascript" src="js/mapviewer.js"></script>
</head>
<body>
<table style="width:100%; height:100%;">
<tbody>
<tr>
<td align="center"><img src="images/loading.gif" alt="Loading" /></td>
</tr>
</tbody>
</table>
<span id="temp"> </span>
<script type="text/javascript">
try {
var b = EsriUtils.getPageBounds();
document.body.removeChild(document.getElementById("temp"));
var pw = EsriUtils.getStyleValue(EsriUtils.getStyleByClassName("#panel").width);
var sw = EsriUtils.getStyleValue(EsriUtils.getStyleByClassName("#layoutslider").width);
var hh = EsriUtils.getStyleValue(EsriUtils.getStyleByClassName("#header").height);
var width = b.width - pw - sw - ieBuffer;
var height = b.height - hh;
document.write("<meta http-equiv='refresh' content='1; URL=map.jsf" + "?width=" + width + "&height=" + height + "'>");
}
catch (exception) {
document.write("<meta http-equiv='refresh' content='1; URL=map.jsf'>");
}
</script>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ArcGIS</title>
<link rel="stylesheet" title="base" href="css/base-style.css" type="text/css" media="screen" />
<style type="text/css">
body { overflow:auto; }
</style>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" language="Javascript" src="js/esri_core.js"></script>
<script type="text/javascript" language="Javascript" src="js/mapviewer.js"></script>
</head>
<body>
<table style="width:100%; height:100%;">
<tbody>
<tr>
<td align="center"><img src="images/loading.gif" alt="Loading" /></td>
</tr>
</tbody>
</table>
<span id="temp"> </span>
<script type="text/javascript">
try {
var b = EsriUtils.getPageBounds();
document.body.removeChild(document.getElementById("temp"));
var pw = EsriUtils.getStyleValue(EsriUtils.getStyleByClassName("#panel").width);
var sw = EsriUtils.getStyleValue(EsriUtils.getStyleByClassName("#layoutslider").width);
var hh = EsriUtils.getStyleValue(EsriUtils.getStyleByClassName("#header").height);
var width = b.width - pw - sw - ieBuffer;
var height = b.height - hh;
document.write("<meta http-equiv='refresh' content='1; URL=map.jsf" + "?width=" + width + "&height=" + height + "'>");
}
catch (exception) {
document.write("<meta http-equiv='refresh' content='1; URL=map.jsf'>");
}
</script>
</body>
</html>
Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page contentType="text/html; charset=ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.esri.com/adf/web" prefix="a"%>
<f:view>
<html>
<head>
<title>Simple ArcGIS Server Viewer</title>
</head>
<body bgcolor="#FFFFFF" leftmargin="10" topmargin="10" marginwidth="5"
marginheight="5">
<h:form id="frmMap">
<a:context value="#{mapContext}" />
<table width="90" cellpadding="3" class="leftmnutables"
align="center" border="1">
<tr>
<td>
</td>
</tr>
<tr>
<td>
<div id="MapDiv">
<a:map id="Map0" value="#{mapContext.webMap}" width="400"
height="400" />
</div>
</td>
</tr>
</table>
</h:form>
</body>
</html>
</f:view>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page contentType="text/html; charset=ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.esri.com/adf/web" prefix="a"%>
<f:view>
<html>
<head>
<title>Simple ArcGIS Server Viewer</title>
</head>
<body bgcolor="#FFFFFF" leftmargin="10" topmargin="10" marginwidth="5"
marginheight="5">
<h:form id="frmMap">
<a:context value="#{mapContext}" />
<table width="90" cellpadding="3" class="leftmnutables"
align="center" border="1">
<tr>
<td>
</td>
</tr>
<tr>
<td>
<div id="MapDiv">
<a:map id="Map0" value="#{mapContext.webMap}" width="400"
height="400" />
</div>
</td>
</tr>
</table>
</h:form>
</body>
</html>
</f:view>
(3)配置文件,这是最麻烦的东西了,但老重要了,
web.xml,这里已经是最简单的了,不要尝试那个能删掉,我已经试过了,具体代表什么意思,有的知道,有的不知道了,你可以看看
http://warrenwyf.spaces.live.com/?_c11_BlogPart_pagedir=Next&_c11_BlogPart_handle=cns!C71882196B68EEE5!628&_c11_BlogPart_BlogPart=blogview&_c=BlogPart这个,权威!
Code
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="WebApp_ID">
<display-name>Web Mapping Application</display-name>
<!-- Context Parameters -->
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>
/WEB-INF/functionalities/aims-functionalities.xml,
/WEB-INF/functionalities/ags-functionalities.xml,
/WEB-INF/functionalities/aws-functionalities.xml,
/WEB-INF/functionalities/wms-functionalities.xml,
/WEB-INF/functionalities/ejb-functionalities.xml,
/WEB-INF/functionalities/graphics-functionalities.xml,
/WEB-INF/ajax-renderers.xml,
/WEB-INF/context-attributes.xml
</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>com.esri.adf.LOG_LEVEL</param-name>
<param-value>SEVERE</param-value>
</context-param>
<!--<security-filter>-->
<filter>
<filter-name>SessionTimeout</filter-name>
<filter-class>
com.esri.adf.web.util.ADFSessionTimeoutFilter
</filter-class>
</filter>
<filter>
<filter-name>ADFFilter</filter-name>
<filter-class>com.esri.adf.web.util.ADFFilter</filter-class>
</filter>
<!--<security-filter-mapping>-->
<filter-mapping>
<filter-name>SessionTimeout</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>ADFFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
<listener>
<listener-class>
com.esri.adf.web.util.ADFServletContextListener
</listener-class>
</listener>
<!-- Servlets -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>MimeData Servlet</servlet-name>
<servlet-class>com.esri.adf.web.util.ADFMimeDataServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>Tile Servlet</servlet-name>
<servlet-class>com.esri.adf.web.util.ADFTileServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>Upload Servlet</servlet-name>
<servlet-class>com.esri.adf.web.util.ADFUploadServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>Download Servlet</servlet-name>
<servlet-class>com.esri.adf.web.util.ADFDownloadServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Servlet Mappings -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>MimeData Servlet</servlet-name>
<url-pattern>/mimedata/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Tile Servlet</servlet-name>
<url-pattern>/tile/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Upload Servlet</servlet-name>
<url-pattern>/upload</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Download Servlet</servlet-name>
<url-pattern>/download</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<!--<security-constraint>-->
</web-app>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="WebApp_ID">
<display-name>Web Mapping Application</display-name>
<!-- Context Parameters -->
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>
/WEB-INF/functionalities/aims-functionalities.xml,
/WEB-INF/functionalities/ags-functionalities.xml,
/WEB-INF/functionalities/aws-functionalities.xml,
/WEB-INF/functionalities/wms-functionalities.xml,
/WEB-INF/functionalities/ejb-functionalities.xml,
/WEB-INF/functionalities/graphics-functionalities.xml,
/WEB-INF/ajax-renderers.xml,
/WEB-INF/context-attributes.xml
</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>com.esri.adf.LOG_LEVEL</param-name>
<param-value>SEVERE</param-value>
</context-param>
<!--<security-filter>-->
<filter>
<filter-name>SessionTimeout</filter-name>
<filter-class>
com.esri.adf.web.util.ADFSessionTimeoutFilter
</filter-class>
</filter>
<filter>
<filter-name>ADFFilter</filter-name>
<filter-class>com.esri.adf.web.util.ADFFilter</filter-class>
</filter>
<!--<security-filter-mapping>-->
<filter-mapping>
<filter-name>SessionTimeout</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>ADFFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
<listener>
<listener-class>
com.esri.adf.web.util.ADFServletContextListener
</listener-class>
</listener>
<!-- Servlets -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>MimeData Servlet</servlet-name>
<servlet-class>com.esri.adf.web.util.ADFMimeDataServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>Tile Servlet</servlet-name>
<servlet-class>com.esri.adf.web.util.ADFTileServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>Upload Servlet</servlet-name>
<servlet-class>com.esri.adf.web.util.ADFUploadServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>Download Servlet</servlet-name>
<servlet-class>com.esri.adf.web.util.ADFDownloadServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Servlet Mappings -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>MimeData Servlet</servlet-name>
<url-pattern>/mimedata/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Tile Servlet</servlet-name>
<url-pattern>/tile/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Upload Servlet</servlet-name>
<url-pattern>/upload</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Download Servlet</servlet-name>
<url-pattern>/download</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<!--<security-constraint>-->
</web-app>
faces-config.xml,这个里的都明白,就是配置数据了,但还是有一条,就是mapContext。webMap,这个webMap是哪的东西啊,是context-attribs里的吗?但它里面没有webMap这个变量只有这个类啊?
Code
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN" "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config xmlns="http://java.sun.com/JSF/Configuration">
<managed-bean>
<managed-bean-name>mapContext</managed-bean-name>
<managed-bean-class>
com.esri.adf.web.data.WebContext
</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>attributes</property-name>
<map-entries>
<map-entry>
<key>map</key>
<value>#{map}</value>
</map-entry>
</map-entries>
</managed-property>
<managed-property>
<property-name>resources</property-name>
<map-entries>
<!-- Resources [START] -->
<!-- Resources [END] -->
<map-entry>
<key>ags1</key>
<value>#{ags1}</value>
</map-entry>
</map-entries>
</managed-property>
</managed-bean>
<!-- MapViewer Phase Listener -->
<lifecycle>
<phase-listener>
com.esri.adf.web.templates.MapViewerPhaseListener
</phase-listener>
</lifecycle>
<managed-bean>
<managed-bean-name>agsUser1</managed-bean-name>
<managed-bean-class>
com.esri.adf.web.ags.data.AGSUser
</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
<managed-property>
<property-name>passwordEncrypted</property-name>
<value>false</value>
</managed-property>
<managed-property>
<property-name>domain</property-name>
<value>10.2.9.20</value>
</managed-property>
<managed-property>
<property-name>userName</property-name>
<value>administrator</value>
</managed-property>
<managed-property>
<property-name>password</property-name>
<value>oil</value>
</managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>ags1</managed-bean-name>
<managed-bean-class>
com.esri.adf.web.ags.data.AGSLocalMapResource
</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
<managed-property>
<property-name>user</property-name>
<value>#{agsUser1}</value>
</managed-property>
<managed-property>
<property-name>alias</property-name>
<value>全球数据</value>
</managed-property>
<managed-property>
<property-name>serverObjectName</property-name>
<value>upstair</value>
</managed-property>
<managed-property>
<property-name>hosts</property-name>
<list-entries>
<value>10.2.9.22</value>
</list-entries>
</managed-property>
<managed-property>
<property-name>functionalities</property-name>
<map-entries>
<map-entry>
<key>map</key>
<value>#{agsMap}</value>
</map-entry>
</map-entries>
</managed-property>
</managed-bean>
</faces-config>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN" "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config xmlns="http://java.sun.com/JSF/Configuration">
<managed-bean>
<managed-bean-name>mapContext</managed-bean-name>
<managed-bean-class>
com.esri.adf.web.data.WebContext
</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>attributes</property-name>
<map-entries>
<map-entry>
<key>map</key>
<value>#{map}</value>
</map-entry>
</map-entries>
</managed-property>
<managed-property>
<property-name>resources</property-name>
<map-entries>
<!-- Resources [START] -->
<!-- Resources [END] -->
<map-entry>
<key>ags1</key>
<value>#{ags1}</value>
</map-entry>
</map-entries>
</managed-property>
</managed-bean>
<!-- MapViewer Phase Listener -->
<lifecycle>
<phase-listener>
com.esri.adf.web.templates.MapViewerPhaseListener
</phase-listener>
</lifecycle>
<managed-bean>
<managed-bean-name>agsUser1</managed-bean-name>
<managed-bean-class>
com.esri.adf.web.ags.data.AGSUser
</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
<managed-property>
<property-name>passwordEncrypted</property-name>
<value>false</value>
</managed-property>
<managed-property>
<property-name>domain</property-name>
<value>10.2.9.20</value>
</managed-property>
<managed-property>
<property-name>userName</property-name>
<value>administrator</value>
</managed-property>
<managed-property>
<property-name>password</property-name>
<value>oil</value>
</managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>ags1</managed-bean-name>
<managed-bean-class>
com.esri.adf.web.ags.data.AGSLocalMapResource
</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
<managed-property>
<property-name>user</property-name>
<value>#{agsUser1}</value>
</managed-property>
<managed-property>
<property-name>alias</property-name>
<value>全球数据</value>
</managed-property>
<managed-property>
<property-name>serverObjectName</property-name>
<value>upstair</value>
</managed-property>
<managed-property>
<property-name>hosts</property-name>
<list-entries>
<value>10.2.9.22</value>
</list-entries>
</managed-property>
<managed-property>
<property-name>functionalities</property-name>
<map-entries>
<map-entry>
<key>map</key>
<value>#{agsMap}</value>
</map-entry>
</map-entries>
</managed-property>
</managed-bean>
</faces-config>
context-attributes。xml,干什么用的 ,好像就是说地图用一个Png图片显示了
Code
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN" "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config xmlns="http://java.sun.com/JSF/Configuration">
<managed-bean>
<managed-bean-name>map</managed-bean-name>
<managed-bean-class>com.esri.adf.web.data.WebMap</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
<managed-property>
<property-name>imageFormat</property-name>
<value>PNG</value>
</managed-property>
</managed-bean>
</faces-config>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN" "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config xmlns="http://java.sun.com/JSF/Configuration">
<managed-bean>
<managed-bean-name>map</managed-bean-name>
<managed-bean-class>com.esri.adf.web.data.WebMap</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
<managed-property>
<property-name>imageFormat</property-name>
<value>PNG</value>
</managed-property>
</managed-bean>
</faces-config>
ajax-renderers。xml,就是一个简单的地图,你移动它就要用到这个配置文件,主要是实现ajax的,没有肯定不行了。
Code
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN" "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<managed-bean>
<display-name>AJAXRenderers</display-name>
<managed-bean-name>AJAXRenderers</managed-bean-name>
<managed-bean-class>java.util.ArrayList</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<list-entries>
<value>#{ajaxMapRenderer}</value>
</list-entries>
</managed-bean>
<managed-bean>
<managed-bean-name>ajaxMapRenderer</managed-bean-name>
<managed-bean-class>
com.esri.adf.web.faces.renderkit.xml.ajax.MapRenderer
</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
</managed-bean>
</faces-config>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN" "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<managed-bean>
<display-name>AJAXRenderers</display-name>
<managed-bean-name>AJAXRenderers</managed-bean-name>
<managed-bean-class>java.util.ArrayList</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<list-entries>
<value>#{ajaxMapRenderer}</value>
</list-entries>
</managed-bean>
<managed-bean>
<managed-bean-name>ajaxMapRenderer</managed-bean-name>
<managed-bean-class>
com.esri.adf.web.faces.renderkit.xml.ajax.MapRenderer
</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
</managed-bean>
</faces-config>
ags-functionalities。xml,这个就是在faces-config。xml里定义的那些functionalities。还有好几个类似文件,直接拷贝进来就好了。
Code
<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN" "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<managed-bean>
<managed-bean-name>agsMap</managed-bean-name>
<managed-bean-class>com.esri.adf.web.ags.data.AGSMapFunctionality</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
</managed-bean>
</faces-config>
<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN" "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<managed-bean>
<managed-bean-name>agsMap</managed-bean-name>
<managed-bean-class>com.esri.adf.web.ags.data.AGSMapFunctionality</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
</managed-bean>
</faces-config>
(4)js文件夹,拷贝进来,images,自己定义也可以,src下加入res和xsl,必须的。
奇怪的一个就是必须有MapViewerPhaseListener。java,好像是为了实现地图拖动吧,但在什么时候调用,我还没找到。
(5)类库,直接拷贝就好了。
这里面多了帮助里没有提到的东西,所以自己按着帮助就连第一个例子就建不起来,就采用删减生成的例子来达到目的了。