TNT blog  
          日歷
          <2025年8月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456
          統計
          • 隨筆 - 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: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 临沂市| 黄平县| 平原县| 盐亭县| 克东县| 临武县| 桃园县| 庆阳市| 襄汾县| 拜城县| 宜丰县| 金华市| 池州市| 乐安县| 赤城县| 曲靖市| 增城市| 兴化市| 乐亭县| 礼泉县| 临澧县| 林西县| 岑巩县| 依兰县| 富民县| 桦南县| 西昌市| 灵丘县| 远安县| 古浪县| 广宁县| 托里县| 涞源县| 庆元县| 惠东县| 孟州市| 怀化市| 清新县| 东安县| 龙口市| 咸丰县|