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 閱讀(127) 評論(0)  編輯  收藏

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


          網站導航:
           
           
          Copyright © TNT Powered by: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 南城县| 梅河口市| 江油市| 东方市| 遂平县| 原阳县| 漯河市| 长子县| 秭归县| 民和| 温州市| 上林县| 西安市| 彰化市| 东山县| 社旗县| 凤冈县| 黑水县| 渝北区| 城口县| 蒙山县| 泰安市| 新野县| 新沂市| 庄河市| 陕西省| 彭州市| 穆棱市| 泸西县| 连城县| 托克逊县| 应城市| 靖远县| 商丘市| 芷江| 江山市| 揭西县| 泸水县| 湾仔区| 启东市| 临朐县|