TNT blog  
          日歷
          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345
          統計
          • 隨筆 - 5
          • 文章 - 40
          • 評論 - 7
          • 引用 - 0

          導航

          常用鏈接

          留言簿(2)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          收藏夾

          home

          搜索

          •  

          最新隨筆

          最新評論

          閱讀排行榜

           
          tomat root 目錄下的index.jsp
          <%@ page import="org.apache.regexp.RE"%>
          <%@ page import="org.apache.regexp.RESyntaxException"%>
          <%
              String requestURL = request.getRequestURL().toString();
              String requestURI = request.getRequestURI();
              String contentPath= request.getContextPath();
               System.out.println("contentPath:"+contentPath);
              //System.out.println( ">>> requestURI="+requestURI );
             
              RE REmloveRef=null;
              try {
                  REmloveRef = new RE("^http://[A-Za-z0-9]*.blog.my3city.cn", RE.MATCH_CASEINDEPENDENT);
                  //REmloveRef = new RE("^http://[A-Za-z0-9]*.blog.andylau.com", RE.MATCH_CASEINDEPENDENT);
              } catch (RESyntaxException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }   
              // for andylau
              //*.blog.andylau.com
            //  System.out.prinln(">>>>REmloveRef.match(requestURL):"+REmloveRef.match(requestURL));
              if(REmloveRef!=null&&REmloveRef.match(requestURL))
              {
                  String uid="";
                  String tmp=requestURL.substring(7);
                  int pot=tmp.indexOf(".");
                  if(pot>0)
                  {
                      uid=tmp.substring(0,pot);
                      //System.out.println(">>>>the uid:"+uid);
                      //System.out.println("/andylau/andylau/blog/personMain.do?ownerId="+uid);
                  }
                   response.sendRedirect("/andylau/andylau/blog/personMain.do?ownerId="+uid);
              }else{
                    response.sendRedirect("/andylau/index.do");
              }
             
              //if ( requestURL.startsWith("http://www") ) {
               //           response.sendRedirect("/andylau/index.do");
                //  } else {
                 //         response.sendRedirect("/andylau/myhome/index.do");
                 // }
          %>


          posted on 2007-04-19 17:38 TNT 閱讀(128) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
           
          Copyright © TNT Powered by: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 临汾市| 利津县| 安庆市| 黄骅市| 隆尧县| 北宁市| 临江市| 麟游县| 大城县| 锡林浩特市| 无为县| 永定县| 慈溪市| 汝州市| 滕州市| 石台县| 兰西县| 和硕县| 新龙县| 修水县| 潞城市| 碌曲县| 清新县| 衢州市| 嘉黎县| 绥滨县| 岳池县| 南安市| 宁明县| 宕昌县| 柘城县| 镇巴县| 安溪县| 益阳市| 闻喜县| 台安县| 合肥市| 砀山县| 吉林省| 大安市| 寿宁县|