TNT blog  
日历
<2024年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
统计
  • 随笔 - 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 阅读(119) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 
 
Copyright © TNT Powered by: 博客园 模板提供:沪江博客