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>