自定义 ThingWorx Navigate > 创建自定义任务 > 将 ThingWorx 服务器配置为与 ThingView 小组件配合使用
将 ThingWorx 服务器配置为与 ThingView 小组件配合使用
ThingView 小组件使用 WebAssembly 技术来呈现 3D 图形。当您在浏览器中查看 3D 数据时,浏览器会下载 ThingView WebAssembly 文件。要在浏览器中优化 WebAssembly 文件的下载和初始化,请将服务器配置用于 WebAssembly MIME 类型。
要配置 Apache Tomcat 服务器,请编辑 web.xmlserver.xml 文件。
1. 打开 <Apache_Tomcat_Installation>/conf/web.xml 文件进行编辑。请确保该文件包含以下代码:
<mime-mapping>
<extension>wasm</extension>
<mime-type>application/wasm</mime-type>
</mime-mapping>
2. 打开 <Apache_Tomcat_Installation>/conf/server.xml 文件进行编辑。请确保 compressableMimeType 属性包含 application/wasm MIME 类型,如以下示例所示:
<Connector port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol"
connectionTimeout="20000"
redirectPort="8445"
compression="on"
compressionMinSize="1024"
compressableMimeType="application/wasm,text/html,text/xml,text/plain,text/css,text/javascript,application/javascript"/>
这对您有帮助吗?