tomcat配置虛擬路徑及配置geoserver的跨域問題解決


在tomcat/conf/Catalina/localhost路徑下添加xxx.xml文件

xxx.xml文件內容為:

<?xml version="1.0" encoding="UTF-8"?>
<Context
docBase="F:\soft\geo"  //文件映射地址
reloadable="true">
</Context>

 

訪問地址為:localhost:8080/xxx/

 

------------------------------------------------------

在tomcat中添加geoserver

1、將geoserver的war包放進tomcat的webapp文件夾中

2、apache-tomcat\conf文件下tomcat-users.xml添加賬號密碼

 <user username="admin" password="1234" roles="manager-gui"/>

3、localhost:8080/geoserver  默認用戶名為admin密碼為geoserver

4、修改默認切片目錄,在webapp/geoserver/WEB-INF/web.xml加入

<context-param>     
    <param-name>GEOWEBCACHE_CACHE_DIR</param-name>                 
    <param-value>切片存放路徑。。</param-value> 
</context-param>

------------------------------------------------------

解決tomcat中geoserver跨域問題

1、在maven下載java-property-utils-1.9.1.jar、cors-filter-2.5.jar包

2、將jar包放入webapps\geoserver\WEB-INF\lib中

3、打開webapps\geoserver\WEB-INF\web.xml,在適當的位置加入以下代碼:

    <filter>  
        <filter-name>CORS</filter-name>  
        <filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>  
        <init-param>
            <param-name>cors.tagRequests</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>  
    <filter-mapping>  
        <filter-name>CORS</filter-name>  
        <url-pattern>/*</url-pattern>  
    </filter-mapping>

4、重啟tomcat,進入tomcat首頁Manager App中重啟geoserver

ps:tomcat解決跨域問題(讀取terrian地形數據)https://www.cnblogs.com/zhaoyanhaoBlog/p/9370830.html

 

-----------------------------------------------------------

轉載請注明出處:https://www.cnblogs.com/implementer/


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM