Servlet で redirect した時の location ヘッダにセットされる ホスト名ってどうなっているのか Servlet では HttpServletResponse.sendRedirect(location) メソッド使ってリダイレクトできますが、 この location に相対パスを設定した場合でも location ヘッダには 絶対パスが出力されます。 この時のホスト名は なんの情報から設定されるのだろうか? という疑問 Tomcat7.0 の ソースで調べてみた。 Response.java をみると sendRedirect(String location) があり、この中で toAbsolute が呼ばれていて、ここで 相対パス -> 絶対パスへの変換がされているようだ ... protected String toAbsolute(String locatio