glassfishにswfファイルを提供する際に問題があります。 私のアプリケーションでは、DataTableにTableToolsプラグインを使用するためのswfファイルが少しあります。このページをすべてのブラウザで開こうとすると、すべてうまく行きますが、IEでは動作がかなり異なります。それは直接URLで警告がブラウザにファイル(オープン、保存、名前を付けて保存)と何をしなければならないかを選択するように頼んだら、開いたままにするが、何も表示されない。 この問題はIEでのみ表示される。 "リソースはドキュメントとして解釈されますが、MIMEタイプapplication/x-shockwave-flashで転送されました。"という警告が表示されるため、コンテンツタイプエラーと思われます。Glassfish V3でIEでswfファイルを提供する問題
が、私は知らないどのように私はセットアップ正しいコンテンツタイプをすることができます 私のweb.xml:エラーロードswfファイルとの最後の3行を見ることができます下の画像から
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name>ManagementConsole</display-name>
<filter>
<filter-name>jersey</filter-name>
<filter-class>com.sun.jersey.spi.container.servlet.ServletContainer</filter-class>
<init-param>
<param-name>com.sun.jersey.config.property.WebPageContentRegex</param-name>
<param-value>/(img|js|css)/.*</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.property.JSPTemplatesBasePath</param-name>
<param-value>/WEB-INF/jsp</param-value>
</init-param>
</filter>
<filter>
<filter-name>RedirectWrongRequest</filter-name>
<filter-class>com.italtel.patchfinder.filters.RedirectWrongRequest</filter-class>
<init-param>
<param-name>exclude</param-name>
<param-value>/LoginServlet</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>RedirectWrongRequest</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>jersey</filter-name>
<url-pattern>/admin/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>LoginServlet</servlet-name>
<jsp-file>/WEB-INF/jsp/login.jsp</jsp-file>
</servlet>
<servlet>
<servlet-name>LoginError</servlet-name>
<jsp-file>/WEB-INF/jsp/loginError.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>LoginServlet</servlet-name>
<url-pattern>/LoginServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>LoginError</servlet-name>
<url-pattern>/LoginError</url-pattern>
</servlet-mapping>
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>
</jsp-config>
<security-constraint>
<display-name>AdminPages</display-name>
<web-resource-collection>
<web-resource-name>admin</web-resource-name>
<description/>
<url-pattern>/admin/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>HEAD</http-method>
<http-method>PUT</http-method>
<http-method>OPTIONS</http-method>
<http-method>TRACE</http-method>
<http-method>DELETE</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
<!--<role-name>USERS</role-name>-->
</auth-constraint>
<user-data-constraint>
<!--None in http mode, Confidential in https mode-->
<!--<transport-guarantee>NONE</transport-guarantee>-->
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/LoginServlet</form-login-page>
<form-error-page>/LoginError</form-error-page>
</form-login-config>
<!--<realm-name>userauth</realm-name>-->
</login-config>
<security-role>
<description/>
<role-name>admin</role-name>
<!--<role-name>USERS</role-name>-->
</security-role>
<welcome-file-list>
<welcome-file>Menu</welcome-file>
</welcome-file-list>
</web-app>
(と正しいコンテンツタイプ)
http://i.stack.imgur.com/Jh98S.png
ヘッダ:リクエストURLます。https://0.0.0.0/ManagementConsole/swf/a.swf 要求メソッド:GET ステータスコード:200のOK リクエストヘッダ 受け入れ:アプリケーション/ xmlの、アプリケーション/ XHTMLユーザエージェント:Mozilla/5.0(Windows; U; Windows NT 6.1; en-US)ユーザエージェント:Mozilla/5.0(Windows; U) AppleWebKit/534.7(ゲッコーのようなKHTMLは、)クローム/ 7.0.517.44 Safariの/ 534.7 レスポンスヘッダ のAccept-範囲は:1871 のContent-Type:application/x-shockwave-flashを 日:月、22 のContent-Lengthバイト2010年11月15日15:09:11 GMT ETag:W/"1871-1290437702000" 最終更新日:2010年11月22日(月)14:55:02 GMT サーバー:GlassFish v3 X-Powered-By:Servlet/3.0 – sebbalex