Legacy Knowledge Base
公開されました Jun. 30, 2025

サイト構成で仮想ホストを使用している場合、サーブレット フィルタが呼び出されない

Written By

Kanchan Bisht

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

問題

  • フレンドリ URL 用のサーブレット フィルタの実装が問題を引き起こしています。 仮想ホストを構成しなくても期待どおりに機能しますが、仮想ホストが構成されている場合、フィルターは呼び出されません。

Environment

  • Liferay DXP 7.4 アップデート 23

解決策

  • 根本的な原因は VirtualHostFilter URI を '/' から '/web/guest' に変更したため、フィルターの URL パターンが一致しなくなりました。 結果として、以下をそれぞれのコードに追加する必要があるようです:
    "url-pattern=/web/guest/*", "url-pattern=/"
    "before- filter=Virtual Host Filter"
    例:
    @Component(
    immediate = true,
    property = {
    "before-filter=Virtual Host Filter", "servlet-context-name=",
    "servlet-filter-name=redirectLoggedUsersFilter",
    "url-pattern=/web/guest/*", "url-pattern=/"
    },
    service = Filter.class
    )

追加情報

  • 「Global Service Team」と呼ばれる別のチャネルがあり、コード レベルまたは任意の開発領域で追加の支援を提供できます。
Did this article resolve your issue ?

Legacy Knowledge Base