天下第二博

Tian Xia The Second BO
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Apache 下使用htc组件问题

Posted on 2008-06-03 11:53  Nuke'Blog  阅读(581)  评论(0)    收藏  举报
 
HTC (HTML Component) HTML组件——从5.5版本开始,Internet Explorer(IE)开始支持Web 行为的概念。这些行为是由后缀名为.htc的脚本文件描述的,它们定义了一套方法和属性,程序员几乎可以把这些方法和属性应用到HTML页面上的任何元素上去。采用HTC带来的好处是巨大的。但是由于 HTC 是 Microsoft 提出的技术。

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>