クラス UrlFilenameViewController
java.lang.ObjectSE
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.support.WebContentGenerator
org.springframework.web.servlet.mvc.AbstractController
org.springframework.web.servlet.mvc.AbstractUrlViewController
org.springframework.web.servlet.mvc.UrlFilenameViewController
- 実装されているすべてのインターフェース:
Aware, ApplicationContextAware, ServletContextAware, Controller
URL の仮想パスをビュー名に変換してそのビューを返す単純な
Controller 実装。 オプションで、prefix を付加したり、suffix を付加したりして、URL ファイル名からビュー名を作成できます。
以下の例をいくつか参照してください。
"/index" -> "index""/index.html" -> "index""/index.html"+ 接頭辞"pre_"および接尾辞"_suf" -> "pre_index_suf""/products/view.html" -> "products/view"
接頭辞 / 接尾辞のサポートを提案してくれた David Barri に感謝します!
- 作成者:
- Alef Arendsen, Juergen Hoeller, Rob Harrop
- 関連事項:
フィールドのサマリー
クラス WebContentGenerator から継承されたフィールド
HEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POSTクラス ApplicationObjectSupport から継承されたフィールド
loggerコンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明protected StringSEextractOperableUrl(jakarta.servlet.http.HttpServletRequest request) ビュー名の抽出に適した、指定されたリクエストから URL パスを抽出します。protected StringSE指定されたリクエスト URI から URL ファイル名を抽出します。protected StringSEリクエスト URL ファイル名の前に付けるプレフィックスを返します。protected StringSEリクエスト URL ファイル名に追加するサフィックスを返します。protected StringSEgetViewNameForRequest(jakarta.servlet.http.HttpServletRequest request) URL ファイル名に基づいてビュー名を返します。適切な場合は、プレフィックス / サフィックスが適用されます。protected StringSEURL ファイル名に基づいてビュー名を返します。適切な場合は、プレフィックス / サフィックスが適用されます。protected StringSEpostProcessViewName(StringSE viewName) URL パスで示されるように、指定されたビュー名に基づいて完全なビュー名を作成します。voidビュー名を作成するには、リクエスト URL ファイル名の前に付加するプレフィックスを設定します。voidビュー名を作成するために、リクエスト URL ファイル名に追加するサフィックスを設定します。クラス AbstractUrlViewController から継承されたメソッド
getUrlPathHelper, handleRequestInternal, setAlwaysUseFullPath, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelperクラス AbstractController から継承されたメソッド
handleRequest, isSynchronizeOnSession, setSynchronizeOnSessionクラス WebContentGenerator から継承されたメソッド
applyCacheControl, applyCacheSeconds, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isRequireSession, prepareResponse, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, setVaryByRequestHeadersクラス WebApplicationObjectSupport から継承されたメソッド
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
コンストラクターの詳細
UrlFilenameViewController
public UrlFilenameViewController()
メソッドの詳細
setPrefix
getPrefix
リクエスト URL ファイル名の前に付けるプレフィックスを返します。setSuffix
getSuffix
リクエスト URL ファイル名に追加するサフィックスを返します。getViewNameForRequest
URL ファイル名に基づいてビュー名を返します。適切な場合は、プレフィックス / サフィックスが適用されます。- 次で指定:
- クラス
AbstractUrlViewControllerのgetViewNameForRequest - パラメーター:
request- 現在の HTTP リクエスト- 戻り値:
- このリクエストのビュー名 (非
null) - 関連事項:
extractOperableUrl
ビュー名の抽出に適した、指定されたリクエストから URL パスを抽出します。- パラメーター:
request- 現在の HTTP リクエスト- 戻り値:
- ビュー名の抽出に使用する URL
getViewNameForUrlPath
extractViewNameFromUrlPath
postProcessViewName