TNT blog  
          日歷
          <2025年8月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456
          統(tǒng)計
          • 隨筆 - 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)  編輯  收藏

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


          網(wǎng)站導航:
           
           
          Copyright © TNT Powered by: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 大邑县| 博爱县| 宁阳县| 博野县| 五常市| 礼泉县| 德安县| 常宁市| 达日县| 通道| 三河市| 鄂托克前旗| 贵定县| 神木县| 乐至县| 竹溪县| 高青县| 汤原县| 台北市| 合山市| 桐柏县| 高平市| 宜君县| 仙游县| 永和县| 五指山市| 泗阳县| 华坪县| 高邮市| 金阳县| 崇文区| 双鸭山市| 揭阳市| 左权县| 平塘县| 拉萨市| 太原市| 肇东市| 锡林郭勒盟| 永修县| 曲阜市|