l 在Site Properties的TAB頁填寫如下內容:
hostname localhost:8080 (此處注意端口)
hosAlias localhost
URL http://localhost:8080
Web site dir c:\Tomcat\webapps\test (這里test可以換成我們項目的所在目錄)
l 在server Output的TAB頁填寫如下內容:
Directory Location C:\Tomcat\webapps\test\Output(注意Output的首字母是大寫的,并且在test目錄下請new一個Output文件夾)
URL http://localhost:8080/output(注意端口)
4. 點擊確定,出現輸入登錄對話框,輸入用戶名admin和密碼admin。
5. 點擊工具欄中的new service,在此對話框中填寫如下內容
Name cdfx
Map file C:\ArcIMS\AXL\fx.axl(fx.axl中的地址要和fx.axl的絕對地址保持一致)
Virtual server ImageServer1
在server Output的Tab頁,填寫如下內容:
ImageType Joint Photographic Experts Group-JPEG(*.JPG)
Directory Location C:\Tomcat\webapps\test\Output
URL http://localhost:8080/test/Output
6. 點擊確定后保存,結束service的創建。
代碼移植
1. 請把defaultwebapp解壓縮。復制cdfx目錄到C:\Tomcat\webapps\test\。
2. 打開C:\Tomcat\webapps\test\cdfx下的文件ArcIMSparam.js。注意此文件中的如下兩個變量imsURL, imsOVURL。修改他們的值和上面的配置一致。根據如上的配置,此時把這兩個值修改如下:
var imsURL = 'http://localhost:8080/servlet/com.esri.esrimap.Esrimap?ServiceName=cdfx';
var imsOVURL = 'http://localhost:8080/servlet/com.esri.esrimap.Esrimap?ServiceName=cdfx';
這里需注意三個地方:localhost,8080,cdfx,一定要和自己的配置一致。
3. 在IE中輸入如下連接:http://localhost:8080/test/cdfx/default.htm 。地圖出來的,配置就好了。如果出現問題了,就要好好檢查一下service的屬性是否都寫對了噻。
祝成功!!!
備注:
(1)如果出現"[WRN0401] ArcIMS is not authorized on one or more machines. Keycode required to unlock software"錯誤,說明注冊文件已經過期或不可用。找到<arcInfo安裝目錄>arcGIS\bin\AuthorizationSummary.exe(必須安裝了arcGIS),運行查看arcIMS是否正確注冊。
(2)在“Service的創建”一步中。如果你要在tomcat中建立一個新的站點test,那么你可以把output路徑設為<tomcat安裝目錄>\webapps\test\output,output訪問路徑必須設置為htpp://hostname:port/test/output。不然的話到時候圖片的路徑不對就無法顯示了。