TNT blog |
|
|||
日歷
統計
導航常用鏈接留言簿(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"); // } %> |
![]() |
|
Copyright © TNT | Powered by: 博客園 模板提供:滬江博客 |