?? index.jsp
字號:
<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>UrlRewriteFilter(Url重寫過濾器)Demo</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<style type="text/css">
body{
font-size:12px;
color:#666666;
}
table{
border:1px solid #7DBEFF;
background:#D9ECFF;
margin:2px auto;
}
td {
color:#333333;
font-size:12px;
line-height: 18px;
}
tr{
background:#CAE4FF;
}
.td_head {
font-family: "Verdana, ";
color:#333333;
font-size:12px;
background:#A2D0FF;
text-align:center;
}
.tips{
border:#FF0000 solid 1px;
background:#FFD0D0;
padding:5px;
margin:2px 2px;
}
</style>
</head>
<body>
<h3>UrlRewriteFilter(Url重寫過濾器)Demo (By:bugie 2008-08-13) </h3>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td class="td_head">測試</td>
</tr>
<tr>
<td>1.訪問無參數頁面:<a href="index.html">index.html</a>(重定向到:<a href="index.jsp">index.jsp</a>)<br>
2.訪問有參數頁面:<a href="review-12659374-p1.html">review-12659374-p1.html</a>(重定向到:<a href="review.jsp?id=12659374&page=1">review.jsp?id=12659374&page=1</a>)</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td class="td_head">web.xml配置</td>
</tr>
<tr>
<td><filter><br>
<filter-name>UrlRewriteFilter</filter-name><br>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class><br>
<init-param><br>
<param-name>logLevel</param-name><br>
<param-value>WARN</param-value><br>
</init-param><br>
</filter><br>
<filter-mapping><br>
<filter-name>UrlRewriteFilter</filter-name><br>
<url-pattern>/*</url-pattern><br>
</filter-mapping></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td class="td_head">urlrewrite.xml規則定義</td>
</tr>
<tr>
<td><urlrewrite><br>
<rule><br>
<from>/index.html</from><br>
<to>/index.jsp</to><br>
</rule><br>
<rule><br>
<from>/review-(.*)-p(.*)\.html</from><br>
<to>/review.jsp?id=$1&amp;page=$2</to><br>
</rule><br>
</urlrewrite></td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -