Apache for Linux 下使用htc组件问题

系统环境:Linux RedHat AS5.0+Apache 2.2(端口7001)+WebLogic9.2(端口8002、8003、8004)

WebLogic 为集群布署,由Apache做代理服务器。结果直接访问WebLogic服务器的htc文件能够正常访问(如:在IE栏输入 :8002/test/test.htc,可以获取到文件,提示下载),但如果通过Apache访问则显示空白,什么也没有(如:在IE栏输入:7001/test/test.htc,显示空白,同时鼠标右键无用)。


RESOLUTION
You can resolve the problem on the Apache Web server side if you add the correct MIME type for the HTC behavior with the following command:
AddType text/x-component .htc

If the command AddType is not found or is not available, follow these steps to add the MIME type text/x-component for the .htc file manually to the Apache Web server.
1. Locate the directory /Etc/apache/.
2. Open the file Mime.types.
3. Add the following line to the file: text/x-component htc
4. Save and close the file.
5. Restart the Apache Web server. The Mime.types file is reloaded after you type: /usr/apache/bin/apachectl restart STATUS

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

HTC (HTML Component) HTML组件——从5.5版本开始,Internet Explorer(IE)开始支持Web 行为的概念。这些行为是由后缀名为.htc的脚本文件描述的,它们定义了一套方法和属性,程序员几乎可以把这些方法和属性应用到HTML页面上的任何元素上去。采用HTC带来的好处是巨大的。但是由于 HTC 是 Microsoft 提出的技术。 【LINUX公社  】

RESOLUTION
You can resolve the problem on the Apache Web server side if you add the correct MIME type for the HTC behavior with the following command:
AddType text/x-component .htc

If the command AddType is not found or is not available, follow these steps to add the MIME type text/x-component for the .htc file manually to the Apache Web server.
1. Locate the directory /Etc/apache/.
2. Open the file Mime.types.
3. Add the following line to the file: text/x-component htc
4. Save and close the file.
5. Restart the Apache Web server. The Mime.types file is reloaded after you type: /usr/apache/bin/apachectl restart STATUS

注:Linux AS4默认的apache,配置了MIME类型也无法正常使用.htc组件,建议使用源代码编译安装。

另外:weblogic、WebSphere 中无法正常使用htc组件
*** 解决方法则是在 WebApp 的 web.xml 中加入以下几行
<mime-mapping>
<extension>htc</extension>
<mime-type>text/x-component</mime-type>
</mime-mapping>


---------------------微软--------------------------

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wygdsz.html