public class RelativeRedirectFilter extends OncePerRequestFilter
HttpServletResponse.sendRedirect(String)
EE をオーバーライドし、HTTP ステータスと "Location" ヘッダーを設定して処理します。これにより、サーブレットコンテナーが相対リダイレクト URL を絶対 URL に書き換えないようにします。サーブレットコンテナーはそれを行うために必要ですが、RFC 7231 セクション 7.1.2 の推奨に反し、さらに "X-Forwarded" ヘッダーを必ずしも考慮する必要はありません。注意 : RFC では相対リダイレクトが推奨されていますが、リバースプロキシを使用する一部の構成では動作しない場合があります。
ALREADY_FILTERED_SUFFIX
logger
コンストラクターと説明 |
---|
RelativeRedirectFilter() |
修飾子と型 | メソッドと説明 |
---|---|
protected void | doFilterInternal(HttpServletRequestEE request, HttpServletResponseEE response, FilterChainEE filterChain) doFilter と同じ契約ですが、単一のリクエストスレッド内のリクエストごとに 1 回だけ呼び出されることが保証されています。 |
HttpStatus | getRedirectStatus() 設定済みのリダイレクトステータスを返します。 |
void | setRedirectStatus(HttpStatus status) リダイレクトに使用するデフォルトの HTTP ステータスを設定します。 |
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch
addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public void setRedirectStatus(HttpStatus status)
デフォルトでは、これは HttpStatus.SEE_OTHER
です。
status
- 使用する 3xx リダイレクトステータス public HttpStatus getRedirectStatus()
protected void doFilterInternal(HttpServletRequestEE request, HttpServletResponseEE response, FilterChainEE filterChain) throws ServletExceptionEE, IOExceptionSE
OncePerRequestFilter
doFilter
と同じ契約ですが、単一のリクエストスレッド内のリクエストごとに 1 回だけ呼び出されることが保証されています。詳細については、OncePerRequestFilter.shouldNotFilterAsyncDispatch()
を参照してください。デフォルトの ServletRequest および ServletResponse の代わりに、HttpServletRequest および HttpServletResponse 引数を提供します。
OncePerRequestFilter
の doFilterInternal
ServletExceptionEE
IOExceptionSE