WebLogic 仮想ディレクトリー・マッピングにより、アプリケーションはアプリケーションの文書ルートの外部にあるイメージ・ファイルや静的ファイルなどのファイルを処理できます。
WebSphere ファイル・サービス・フィーチャーを使用してこれらのファイルを処理できます。
この規則は、weblogic.xml ファイル内に <virtual-directory-mapping> エレメントがあることを検出します。ソース・スキャナーでクイック・フィックスが使用可能です。クイック・フィックスは、WebSphere traditional および Liberty の Web 拡張 ファイル内の対応する <fileServingAttributes> エレメントの作成を支援します。
例えば、weblogic.xml ファイルは以下のマッピングを含むことができます。
<virtual-directory-mapping> <local-path>c:/usr/files</local-path> <url-pattern>/images/*</url-pattern> <url-pattern>*.jpg</url-pattern> </virtual-directory-mapping> |
以下の例に示されるように、同じ情報を WebSphere Application Server Web 拡張で定義することができます。
<fileServingAttributes xmi:id ="FileServingAttribute_1" name="extendedDocumentRoot" value="c:/usr/files"/> <fileServingAttributes xmi:id ="FileServingAttribute_2" name="file.serving.patterns.allow" value="/images/* *.jpg"/> |
extendedDocumentRoot ファイル・サービス属性は、アプリケーション Web モジュールの外部に存在する複数のルートを表す、コンマで区切ったストリングです。
file.serving.patterns.allow ファイル・サービス属性は、複数のパターンを表すスペースで区切ったストリングです。
複数の場所に静的コンテンツのあるアプリケーションからのコンテンツを処理するのに
問題が起きることがあります。
WebLogic では、定義された virtual-directory-mapping はどれも
コンテキスト・ルートとディレクトリーの場所の両方から使用可能です。
WebSphere Application Server では、file.serving.patterns.allow プロパティーが、
拡張された文書ルートまたはコンテキスト・ルート内の指定されたパターンに一致する静的コンテンツへの
アクセスを制限します。
ファイルの編成方法によっては、
file.serving.patterns.allow プロパティー値の変更が必要な場合があります。例えば、
<fileServingAttributes xmi:id ="FileServingAttribute_1" name="extendedDocumentRoot" value="/common/files"/> <fileServingAttributes xmi:id ="FileServingAttribute_2" name="file.serving.patterns.allow" value="/images/*"/> |
コンテキスト・ルートの /common/files および
/common/files/images に images ディレクトリーがある場合、
/common/files/images を file.serving.patterns.allow プロパティー値に追加します。
<fileServingAttributes xmi:id ="FileServingAttribute_1" name="extendedDocumentRoot" value="/common/files"/> <fileServingAttributes xmi:id ="FileServingAttribute_2" name="file.serving.patterns.allow" value="/images/* /common/files/images/*"/> |
以下の例の設定を使用してファイルへの幅広いアクセスを許可できますが、この設定を使用すると 意図したよりも多くのコンテンツがアプリケーションで使用可能になることがあります。
<fileServingAttributes xmi:id ="FileServingAttribute_2" name="file.serving.patterns.allow" value="*"/> |
詳細と例については、以下のリソースを参照してください。