HttpServletRequest#getPathInfo()で情報を取るテスト
HttpServletRequest reqについて
http://hogehoge.com/ahoaho/uhihihi
req.getServletPath()が/ahoahoに、
req.getPathInfo()が /uhihihiになる
String key = "";
if (req.getPathInfo()!=null) {
key = req.getPathInfo();
}
res.sendRedirect(url);
String url = "http://www.google.com/search?q="+key;
こんなかんじでリダイレクトさせてみる
http://hogehoge.com/ahoaho/uhihihi
req.getServletPath()が/ahoahoに、
req.getPathInfo()が /uhihihiになる
String key = "";
if (req.getPathInfo()!=null) {
key = req.getPathInfo();
}
res.sendRedirect(url);
String url = "http://www.google.com/search?q="+key;
こんなかんじでリダイレクトさせてみる
JUGEMテーマ:インターネット
コメント
コメントを投稿
「コメントを投稿できるユーザー」の範囲は変更される可能性があります。