- 浏览: 173314 次
- 性别:
- 来自: 宁波
文章分类
- 全部博客 (113)
- EJB3.0 (1)
- Spring+Hibernate+Struts2 (7)
- 杂谈 (27)
- ExtJs2.2 (1)
- 设计模式 (1)
- JBoss Seam (0)
- 以前在学校里学习的笔记 (3)
- 我的智能手机研究文章 (2)
- DIV+CSS美化页面 (6)
- javascript (7)
- POI操作 (2)
- 数据库 (8)
- Tomcat服务器 (2)
- 测试 (3)
- 水区 (5)
- c++ (1)
- 工作流 (0)
- osg (0)
- JS技术 (2)
- ubuntu linux (3)
- svg (1)
- android (17)
- PHP (1)
- webservise (1)
- java (1)
- mongdb (0)
最新评论
-
flytosea:
如果LIB包建立在外面的话,maven不能把jar一起打包
maven 不建立仓库直接加入直接的jar -
javaAlpha:
楼主 总结的太全了。
CSS兼容IE6,IE7,FF的技巧
http://urlrewritefilter.googlecode.com/svn/trunk/src/doc/manual/3.1/index.html#filterparams
有时间翻译下
Install
Download the zip (or tar.gz) and extract it into your context's directory ie, so that urlrewrite.xml goes into the WEB-INF directory.
Add the following to your WEB-INF/web.xml (add it near the top above your servlet mappings (if you have any)): (see filter parameters for more options)
<filter> <filter-name>UrlRewriteFilter</filter-name> <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class> </filter> <filter-mapping> <filter-name>UrlRewriteFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>Add your own configuration to the WEB-INF/urlrewrite.xml that was created.
Restart the context.
You can visit http://127.0.0.1:8080/rewrite-status (or whatever the address of your local webapp and context) to see output (note: this page is only viewable from localhost).
Filter Parameters
There are a few advanced filter parameters for enabling conf file reloading etc. There are self-explanatory.
<filter> <filter-name>UrlRewriteFilter</filter-name> <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class> <!-- set the amount of seconds the conf file will be checked for reload can be a valid integer (0 denotes check every time, -1 denotes no reload check, default -1) --> <init-param> <param-name>confReloadCheckInterval</param-name> <param-value>60</param-value> </init-param> <!-- if you need to the conf file path can be changed it is specified as a path relative to the root of your context (default /WEB-INF/urlrewrite.xml) --> <init-param> <param-name>confPath</param-name> <param-value>/WEB-INF/urlrewrite.xml</param-value> </init-param> <!-- sets up log level (will be logged to context log) can be: TRACE, DEBUG, INFO (default), WARN, ERROR, FATAL, log4j, commons, sysout:{level} (ie, sysout:DEBUG) if you are having trouble using normal levels use sysout:DEBUG (default WARN) --> <init-param> <param-name>logLevel</param-name> <param-value>DEBUG</param-value> </init-param> <!-- you can change status path so that it does not conflict with your installed apps (note, defaults to /rewrite-status) note, must start with / --> <init-param> <param-name>statusPath</param-name> <param-value>/status</param-value> </init-param> <!-- you can disable status page if desired can be: true, false (default true) --> <init-param> <param-name>statusEnabled</param-name> <param-value>true</param-value> </init-param> <!-- you may want to allow more hosts to look at the status page statusEnabledOnHosts is a comma delimited list of hosts, * can be used as a wildcard (defaults to "localhost, local, 127.0.0.1") --> <init-param> <param-name>statusEnabledOnHosts</param-name> <param-value>localhost, dev.*.myco.com, *.uat.mycom.com</param-value> </init-param> <!-- you may want to allow more hosts to look at the status page statusEnabledOnHosts is a comma delimited list of hosts, * can be used as a wildcard (defaults to "localhost, local, 127.0.0.1") --> <init-param> <param-name>statusEnabledOnHosts</param-name> <param-value>localhost, dev.*.myco.com, *.uat.mycom.com</param-value> </init-param> <!-- defaults to false. use mod_rewrite style configuration file (if this is true and confPath is not specified confPath will be set to /WEB-INF/.htaccess) --> <init-param> <param-name>modRewriteConf</param-name> <param-value>false</param-value> </init-param> <!-- load mod_rewrite style configuration from this parameter's value. note, Setting this parameter will mean that all other conf parameters are ignored. <init-param> <param-name>modRewriteConfText</param-name> <param-value> RewriteRule ^/~([^/]+)/?(.*) /u/$1/$2 [R] RewriteRule ^/([uge])/([^/]+)$ /$1/$2/ [R] </param-value> </init-param> --> </filter> <filter-mapping> <filter-name>UrlRewriteFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
Note, setting logLevel to log4j or commons will cause the built in loging to call either log4j or commons-logging as if they were the logging framework, obviously you will need to have the jar for log4j or commons-logging in your classpath.
Configuration File WEB-INF/urlrewrite.xml
Configuration is done via a simple XML file that lives in your WEB-INF folder. It should be named urlrewrite.xml. It may be helpful to read the UrlRewriteFilter DTD (Document Type Definition). Please also make sure you look at the examples. A simple configuration file looks like:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.0//EN" "http://tuckey.org/res/dtds/urlrewrite3.0.dtd"> <urlrewrite> <rule> <from>^/some/olddir/(.*)$</from> <to type="redirect">/very/newdir/$1</to> </rule> <rule match-type="wildcard"> <from>/blog/archive/**</from> <to type="redirect">/roller/history/$1</to> </rule> </urlrewrite>
The urlrewrite.xml file must have a root element called "urlrewrite" and must contain at least one "rule" element.
A "rule" must contain a "from" and a "to", and can have zero or more "condition" elements and zero or more and/or "set" elements.
When a "rule" is processed against an incoming request, all the "condition" elements must be met, then the "from" will be applied to the request URL and the final URL generated by applying the "to" to the "from" pattern. So long as the rule has matched then the "set" will be run.
When executing a rule the filter will (very simplified) loop over all rules and for each do something like this psuedo code:
Pattern.compile(<from> element); pattern.matcher(request url); matcher.replaceAll(<to> element); if ( <condition> elements match && matcher.find() ) { handle <set> elements (if any) execute <run> elements (if any) perform <to> element (if any) }
<urlrewrite> element
The top level element.
Attribute Possible Value Explanation
default-match-type
(optional) regex (default) All rules and thier conditions will be processed using the Java Regular Expression engine (unless match-type is specified on a rule).
wildcard All rules and thier conditions will be processed using the Wildcard Expression engine (unless match-type is specified on a rule).
decode-using
(optional) utf8 (default) When URL is decoded UTF-8 will be used.
null Do not decode.
[encoding] Any string representing a supported character encoding eg, ISO-8859-1. See Java Charset Object for more info.
use-query-string
(optional) false (default) The query string will not be appended to the url that the "from" element matches against.
true The query string will be appended to the url that the "from" element matches against.
use-context
(optional) false (default) The context path will not be added to the url that the "from" element matches against.
true The context path will be added to the url that the "from" element matches against.
<rule> element
Zero or more. The basis of a rule.
Attribute Possible Value Explanation
enabled
(optional) true (default) Enable this rule.
false Disable this rule.
match-type
(optional) regex (default) This rule and it's conditions will be processed using the Java Regular Expression engine.
wildcard This rule and it's conditions will be processed using the Wildcard Expression engine.
In the following example requests for /world/usa/nyc will be transparently forwarded to /world.jsp
<rule match-type="regex"> <from>^/world/([a-z]+)/([a-z]+)$</from> <to>/world.jsp</to> </rule> <rule match-type="wildcard"> <from>/world/*/*</from> <to>/world.jsp</to> </rule>
<outbound-rule> element
Zero or more. This is very similar to a normal rule but it is used for rewriting urls that go through response.encodeURL().
Attribute Possible Value Explanation
enabled
(optional) true (default) Enable this rule.
false Disable this rule.
encodefirst
(optional) false (default) Run encodeURL() after running this outbound rule.
true Run encodeURL() before running this outbound rule.
May contain "run", "from", "to" and "set" element(s) also. Example:
<outbound-rule> <from>^/world.jsp?country=([a-z]+)&city=([a-z]+)$</from> <to>/world/$1/$2</to> </outbound-rule>
Using the example above JSP's with the code
<a href="<%= response.encodeURL("/world.jsp?country=usa&city=nyc") %>">nyc</a>
will output
<a href="/world/usa/nyc">nyc</a>
Or JSTL
<a href="<c:url value="/world.jsp?country=${country}&city=${city}" />">nyc</a>
will output
<a href="/world/usa/nyc">nyc</a>
Note, If you are using JSTL (ie, <c:url) this will work also.
<name> element
An optional element used for documenting the name of the rule. This can be used with rule and outbound-rule. See ant task.
<rule> <name>World Rule</name> <from>^/world/([a-z]+)/([a-z]+)$</from> <to>/world.jsp?country=$1&city=$2</to> </rule>
<note> element
A simple optional element used for documentation of the rule. This can be used with rule and outbound-rule. See ant task.
<rule> <name>World Rule</name> <note> Cleanly redirect world requests to JSP, a country and city must be specified. </note> <from>^/world/([a-z]+)/([a-z]+)$</from> <to>/world.jsp</to> </rule>
<condition> element
An element that lets you choose condtions for the rule. Note, all conditions must be met for the rule to be run (unless "next" is set to "or" obvoiusly).
Value can be any Regular Expression.
Attribute Possible Value Explanation
type
(optional) header (default) If used, the header name must be specified in the "name" attribute.
method The method of the request. GET, POST, HEAD etc.
port The port that the web application server is running on.
time Current time at the server (this will be the number of seconds since 00:00:00 1970-01-01 UTC otherwise known as unix time).
i.e. (new Date()).getTime()
This can be used for making sure content goes live only at a time you set.
year Current year at the server.
i.e. (Calendar.getInstance()).get(Calendar.YEAR)
month Month at the server. January is 0
i.e. (Calendar.getInstance()).get(Calendar.MONTH)
dayofmonth Day of the month at the server. March first is 1
i.e. (Calendar.getInstance()).get(Calendar.DAY_OF_MONTH)
dayofweek Day of the week at the server. Saturday is 1, Sunday is 7
i.e. (Calendar.getInstance()).get(Calendar.DAY_OF_WEEK)
ampm AM or PM time at the server.
i.e. (Calendar.getInstance()).get(Calendar.AM_PM)
hourofday The hour of the day (24 hour clock) at the server. 10pm is 22
i.e. (Calendar.getInstance()).get(Calendar.HOUR_OF_DAY)
minute The minute field of the current time at the server.
i.e. (Calendar.getInstance()).get(Calendar.MINUTE)
second The second field of the current time at the server.
i.e. (Calendar.getInstance()).get(Calendar.SECOND)
millisecond The millisecond field of the current time at the server.
i.e. (Calendar.getInstance()).get(Calendar.MILLISECOND)
attribute Will check the value of a request attribute (don't confuse this with parameter!), name must be set when using this type.
i.e. request.getAttribute([name])
auth-type Will check the value of a request attribute (don't confuse this with parameter!)
i.e. request.getAuthType()
character-encoding The character encoding of the imcoming request.
i.e. request.getCharacterEncoding()
content-length The length of the imcoming request (can be useful if you want to deny large requests).
i.e. request.getContentLength()
content-type The type of the imcoming request. (this is probably not that useful)
i.e. request.getContentType()
context-path The context path of the imcoming request.
i.e. request.getContextPath()
cookie The value of a cookie, note, name must be specified to use this
i.e. request.getCookies() the find we the one with [name] specified and check the value.
parameter A tidier way of checking request parameters than looking for them in the query string. This will check for the parameter in GET or POST, note, name must be specified.
i.e. request.getParameter([name])
path-info i.e. request.getPathInfo()
path-translated i.e. request.getPathTranslated()
protocol The protocol used to make the request, e.g. HTTP/1.1
i.e. request.getProtocol()
query-string The query string used to make the request (if any), e.g. id=2345&name=bob
i.e. request.getQueryString()
remote-addr The IP address of the host making the request, e.g. 123.123.123.12
i.e. request.getRemoteAddr()
remote-host The host name of the host making the request, e.g. 123qw-dsl.att.com (note, this will only work if your app server is configured to lookup host names, most aren't).
i.e. request.getRemoteHost()
remote-user The login of the user making this request, if the user has been authenticated, e.g. bobt
i.e. request.getRemoteUser()
requested-session-id Returns the session ID specified by the client, e.g. 2344asd234sada4
i.e. request.getRequestedSessionId()
request-uri Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request
i.e. request.getRequestURI()
request-url Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.
i.e. request.getRequestURL()
session-attribute (note, name must be set)
i.e. session.getAttribute([name])
session-isnew Weather the session is new or not.
i.e. session.isNew()
server-name The host name of the server to which the request was sent (from the host header not the machine name).
i.e. request.getServerName()
scheme The scheme used for the request, e.g. http or https
i.e. request.getScheme()
user-in-role (Note, the value for this cannot be a regular expression)
i.e. request.isUserInRole([value])
name
(optional) (can be anything) If type is header, this specifies the name of the HTTP header used to run the value against.
next
(optional) and (default) The next "rule" and this "rule" must match.
or The next "rule" or this "condition" may match.
operator
(optional) equal (default) Equals. The operator to be used when the condition is run, the regular expression matches or the values are equal.
notequal Not equal to. (i.e. request value != condition value). Note, this operator only work with numeric rule types.
greater Greater than. (i.e. request value > condition value). Note, this operator only work with numeric rule types.
less Less than. (i.e. request value < condition value). Note, this operator only work with numeric rule types.
greaterorequal Greater to or equal to. (i.e. request value >= condition value). Note, this operator only work with numeric rule types.
lessorequal Less than or equal to. (i.e. request value <= condition value). Note, this operator only work with numeric rule types.
Examples:
<condition name="user-agent" operator="notequal">Mozilla/[1-4]</condition> <condition type="user-in-role" operator="notequal">bigboss</condition> <condition name="host" operator="notequal">www.example.com</condition> <condition type="method" next="or">PROPFIND</condition> <condition type="method">PUT</condition>
<from> element
You must always have exactly one from for each rule or outbound-rule. Value can be a regular expression in the Perl5 style. Note, from url's are relative to the context.
Attribute Possible Value Explanation
casesensitive
(optional) false (default) This value will be matched using case insentitive match. ie, "/WellingtoN" will match "/wellington".
true This value will be matched using case sentitive match. ie, "/aAa" will NOT match "/aaa".
Example:
<from>^/world/([a-z]+)$</from>
<to> element
Value can be a regular replacement expression in the Perl5 style.
Attribute Possible Value Explanation
type
(optional) forward (default) Requests matching the "conditions" for this "rule", and the URL in the "from" element will be internally forwarded to the URL specified in the "to" element. Note: In this case the "to" URL must be in the same context as UrlRewriteFilter. This is the same as doing:
RequestDispatcher rq = request.getRequestDispatcher([to value]);
rq.forward(request, response);
passthrough Identical to "forward".
redirect Requests matching the "conditions" and the "from" for this rule will be HTTP redirected. This is the same a doing:
HttpServletResponse.sendRedirect([to value]))
permanent-redirect The same as doing:
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
response.setHeader("Location", [to value]);
(note, SC_MOVED_PERMANENTLY is HTTP status code 301)
temporary-redirect The same as doing:
response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
response.setHeader("Location", [to value]);
(note, SC_MOVED_TEMPORARILY is HTTP status code 302)
pre-include
post-include
last
(optional) false (default) The rest of the "rules" will be processed if this one succeeds.
true No more "rules" will be processed if this one is a match.
encode
(optional) false (default if under rule) response.encodeURL([to]) will be run on the to url before performing the rewrite.
true (default if under outbound-rule) response.encodeURL([to]) will NOT be called.
Note, "to" can be null ie, <to>null</to>, this will mean that the request will go no further if the rule is matched (ie, this filter will not call chain.doFilter).
<to>/world.jsp?country=$1</to>
To elements can contain backreferences and variables.
Backreferences
%N
Provides access to the grouped parts (parentheses) of the pattern from the last matched Condition in the current rule. N must be less than 10 and greater than 0 (i.e. %1, %2, %3 etc).
Variables
%{VARIABLE-NAME}
Any valid condition type can be used as a variable name. ie, '%{port}' will be translated to '80', '%{year}' to '2005', '%{cookie:myCookie}' would be translated to 'myCookieValue' (assuming the user had a cookie named myCookie with the value myCookieValue).
Valid types are condition types, see condition for a full description.
Functions
${FUNCTION:PARAMS}
Functions can be places in set and to elements.
name example example returns
replace ${replace:my cat is a blue cat:cat:dog} my dog is a blue dog
replaceFirst ${replace:my cat is a blue cat:cat:dog} my cat is a blue dog
escape ${escape:a b c} a+b+c
unescape ${unescape:a+b+c} a b c
lower ${lower:Hello World} hello world
upper ${upper:hello} HELLO
trim ${trim: abc def } abc def
<set> element
Allows you to set varous things if the rule is matched.
Attribute Possible Value Explanation
type
(optional) request (default) The same as request.setAttribute([name], [value]) (note, name must be set).
session The same as request.getSesison(true).setAttribute([name], [value]) (note, name must be set).
response-header The same as response.setHeader([name], [value]) (note, name must be set).
cookie Value can be in the format "[value][:domain[:lifetime[:path]]]". This sets a cookie on the client's browser. The cookie's name is specified by the name attribute. The domain field is the domain of the cookie, such as '.apache.org',the optional lifetime is the lifetime of the cookie in seconds, and the optional path is the path of the cookie (note, name must be set).
status The same as response.setStatus([value])
content-type The same as response.setContentType([value])
charset The same as response.setCharacterEncoding([value])
expires Will set the Expires HTTP header by adding the time specified and current time (this is mod_expires style). Syntax "{num type}*". Units can be (singular or plural); years, months, weeks, days, hours, minutes, seconds.
eg, "1 day 2 seconds", "3 hours", "1 year 1 hour"
locale The same as response.setLocale([value]) specify the Locale in the format (valid locales are, zh, zh-CN, zh-CN-southern i.e. "-" separating the language, country and variant (if any)).
name
(optional) (can be anything) If type is request, session, response-header, cookie this specifies the name item.
In the following example a request attribute "client" will be set to "AvantGo" or "Samsung SCH-6100", this can be fetched in a servlet or JSP using request.getAttribute("client").
<rule> <condition name="user-agent">Mozilla/3\.0 (compatible; AvantGo .*)</from> <from>.*</from> <set name="client">AvantGo</set> </rule> <rule> <condition name="user-agent">UP\.Browser/3.*SC03 .* </from> <from>.*</from> <set name="client">Samsung SCH-6100</set> </rule>
<run> element
Allows you to run a method on an object when a rule and it's conditions are matched.
Attribute Possible value Explanation
class The class you want to run a method on. Must be a fully qualified name.
method (optional) run (default) The method you want to run, the method must have the parameters (HttpServletRequest, HttpServletResponse) e.g. run(HttpServletRequest request, HttpServletResponse response)
Note, if init(ServletConfig) or destroy() is found they will be run at when creating or destroying an instance.
neweachtime (optional) false (default) One instance for each UrlRewriteFilter instance.
true A new instance of the class will be created before running each time set to true.
When the rule in the following example is matched, WorldServlet.goGet(HttpServletRequest, HttpServletResponse) will be invoked, the request will then be forwarded to /world-presentation.jsp.
<rule> <from>^/world/[a-z]+/[a-z]+$</from> <run class="com.blah.web.WorldServlet" method="doGet" /> <to>/world-presentation.jsp</to> </rule> Note, you can specify init-param's the same way you would for a servlet. <run class="com.blah.web.MyServlet" method="doGet"> <init-param> <param-name>someParamName</param-name> <param-value>10</param-value> </init-param> </run>
If the method being called throws an Exception the original exception will be re-thrown as if it were the original if it extends RuntimeException (eg, NullPointer), other exceptions are wrapped in a ServletException and thrown so your container can handle them.
<class-rule> element
Allows you to run a method every time a request come in for 100% dynamic rules. See the org.tuckey.web.filters.urlrewrite.sample package for an example.
Attribute Explanation
class The class you want to run a method on. Must be a fully qualified name.
method (optional, default matches) The method you want to run, the method must have the parameters (HttpServletRequest, HttpServletResponse) e.g. run(HttpServletRequest request, HttpServletResponse response)
Note, if init(ServletConfig) or destroy() is found they will be run at when creating or destroying an instance.
last (optional, default true If false more rules will be processed following this rule even if it is matched (so that a better match may be found).
Example:
<class-rule class="com.blah.web.MyRuleClass" />
Tips
When you want to put an "&" in a rule you must enter it as the XML entity "&"
For simplicity you might want to start all from's with a ^ and end them with a $.
In regular expressions ^ specifies the start of the string and $ specifies the end.
ie, a request for /my/url/path will NOT match <from>^/url/$</from> but it will match <from>/url/</from>
If using <outbound-rule> remember all urls in your code must be encoded e.g. <a href="">my link</a>
Regular expressions are complex and a bit tricky at times, read regular expression syntax for Java.
If you find regular expressions difficult use Wildcards.
"Context" is important. If you have an app with the context "/myapp" and you request the url "/myapp/somefolder/somepage.jsp", the container tells UrlRewriteFilter that the url is "/somefolder/somepage.jsp". This can be confusing, but basically your rules and conditions should not contain the context path (it will be handled by the container).
Wildcard Matching Engine
The wildcard matching engine can be used instead of regex. It is supported in conditions and rules where match-type is set to wildcard (or default-match-type is set on the urlrewrite element
e.g. /big/url/* will match /big/url/abc.html but will NOT match /big/url/abc/dir/ or /big/url/abc/.
/big/url/** will match /big/url/abc.html, /big/url/abc/dir/ and /big/url/abc/.
You can also use Regular expression style variable replacement, each match of a * will be available for use in to and set elements using simple $1 $2 variables.
e.g. /my/big/url/* will match /my/big/url/abc.html and $1 will be set to abc.html.
Added in 3.0
Ant Task
An Ant task has been written to allow validate the conf file and generation of documentation. You can view a sample.
Paste the following into your build.xml file, then change the dest and conf to point to the correct places. Note, the urlrewrite jar file will need to be in your classpath.
<target name="urlrewrite-doc" depends="compile" description="UrlRewriteFilter validation and documenting"> <taskdef name="urlrewritedoc" classname="org.tuckey.web.filters.urlrewrite.UrlRewriteDocTask" /> <urlrewritedoc conf="${build.home}/WEB-INF/urlrewrite.xml" dest="urlrewrite-conf-overview.html" /> </target>
mod_rewrite Style Configuration
Support for mod_rewrite is considered beta quality. Set modRewriteConf to true in filter parameters and add a WEB-INF/.htaccess file with your mod_rewrite style configuration in it.
Sample web.xml snippet (see also modRewriteConf and modRewriteConfText in Filter Parameters):
<filter> <filter-name>UrlRewriteFilter</filter-name> <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class> <!-- defaults to false. use mod_rewrite style configuration file (if this is true and confPath is not specified confPath will be set to /WEB-INF/.htaccess) --> <init-param> <param-name>modRewriteConf</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>UrlRewriteFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
Sample: WEB-INF/.htaccess
# redirect mozilla to another area RewriteCond %{HTTP_USER_AGENT} ^Mozilla.* RewriteRule ^/no-moz-here$ /homepage.max.html
[L]
Documentation for the original mod_rewrite library mostly applies, differences are documented below.
Attribute Explanation
RewriteLogLevel Specified as int, trasnlated as: <= 1 - FATAL, 2 - ERROR, 3 - INFO, 4 - WARN, >= 5 DEBUG
RewriteLog SYSOUT, SYSERR, log4j, commons (if not set context logging will be used)
RewriteRule Certain flags not supported:
chain flag [C] not supported
env flag [E] not supported
next flag [N] not supported
nosubreq flag [NS] not supported
Proxy flag [P] not supported
qsappend flag [QSA] not supported
Skip flag [S] not supported
RewriteBase Not supported
RewriteLock Not supported
RewriteMap Not supported
RewriteOptions Not supported
发表评论
-
maven 不建立仓库直接加入直接的jar
2012-10-26 10:45 1417<dependency> <grou ... -
HTTP协议详解(真的很经典)
2011-02-16 14:16 1135引言 ... -
git中文资料
2011-02-16 10:06 1139Git入门教程 http://hi.baidu.com/eeh ... -
北京圣思园视频下载及时跟新
2011-01-25 11:44 1779北京圣思园张龙(风中叶)老师的Java Web培训的视频,咨询 ... -
二分查找
2010-12-07 13:11 878public class TestBinSearch { ... -
FlashFXP
2010-12-06 09:48 704-------- FlashFXP Registration ... -
Netbeans 6.9.1 设置为英文界面
2010-11-22 09:29 1141问题:从官网下载的netbeans不论是中文版还是英文版默认的 ... -
Fat jar 非常不错的打包插件
2010-08-25 06:30 773http://fjep.sourceforge.net/ -
实践与共享:微软近日发布麾下杀毒软件最新版本 Microsoft Security Essentials 2.0 中文版
2010-08-13 12:22 870近日,微软将其麾下杀毒软件“MSE”升级到了V2.0.3 ... -
推荐Swing编程学习网站
2010-08-12 19:20 887本人向大家提供几个个Swing学习交流的平台 swingch ... -
“第六感装置”的惊人潜力
2010-03-19 23:13 1025我们总是在于“现实生活”和“电脑的数字生活”中的差异,这两个世 ... -
vim笔记
2010-01-04 16:48 836vi的模式mode NormalMode :命令模式,使用a、 ... -
IntelliJ Idea 常用快捷键
2009-10-08 20:41 717Alt+回车 导入包,自动修正 Ctrl+N 查找类 Ct ... -
Eclipse提高工作效率的好习惯
2009-09-09 10:38 896Eclipse 快捷键设置-更 ... -
共享内存在Java中的实现和应用
2009-07-14 17:21 928共享内存在Java中的实现 ... -
jsp笔记
2009-07-14 17:17 629JSP 的9 个内置对象 application: java ... -
命令文档
2009-07-09 20:58 819net use \\ip\ipc$ " " ... -
[转]常用正则表达式收集
2009-06-24 14:35 818正则表达式用于字符串处理、表单验证等场合,实用高效。现将一些常 ... -
Excel中如何一次性去掉多个超链接
2009-06-15 17:44 29311.点击“宏”→“查看宏”,选择“宏名”下的“RemoveHy ... -
详解如何让MyEclipse具有强大的提示功能
2009-06-13 17:37 811先举个简单的例子说明 ...
相关推荐
urlrewrite Jar包 urlrewrite-3.1.0.jar
jar包,官方版本,自测可用
URL重写过滤器(URL Rewrite Filter)是一种在Java Web应用程序中使用的开源工具,主要用于修改HTTP请求的URL,以便实现友好的、SEO优化的或者更安全的URL结构。这个过滤器通常与Apache Tomcat服务器和Spring MVC等...
标题“urlrewrite2伪静态与使用文档(IIS)”涉及到的是在IIS(Internet Information Services)服务器环境中,使用urlrewrite2模块实现URL重写和伪静态功能的技术内容。URL重写是Web开发中的一项关键技术,它允许...
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class> <param-name>logLevel <param-value>WARN <param-name>statusEnabled <param-value>true </filter> <filter-...
为了实现URL重写功能,我们需要在`web.xml`中配置URL Rewrite Filter,并在`urlrewrite.xml`中定义重写规则。 **1. `web.xml` 配置:** ```xml <filter> <filter-name>UrlRewriteFilter</filter-name> <filter-...
2. 配置web.xml:在`web.xml`中添加`Filter`和`Filter-Mapping`,以启动`urlrewrite`过滤器。 3. 编写urlrewrite.xml:这是URL重写的核心配置文件,定义了各种URL重写规则。 4. 测试与调试:运行项目,通过浏览器...
1. **安装**:下载并安装IIS URL重写2的扩展,通常是`IIS Urlrewrite2.exe`文件,通过IIS Manager进行安装。 2. **添加规则**:在IIS Manager中选择目标站点,然后在“管理服务”下找到“URL重写”,点击“添加规则...
《URL重写技术详解——基于UrlRewrite工具的实践指南》 在Web开发领域,URL重写是一项重要的技术,它能够使网站的URL更加友好、简洁,提高用户体验,同时也有利于搜索引擎优化(SEO)。本篇文章将围绕“UrlRewrite....
集成`URLrewrite`到Java Web应用中,通常需要在web.xml中配置Filter,指定`urlrewrite.xml`的位置,然后在Servlet容器启动时加载配置: ```xml <filter> <filter-name>UrlRewriteFilter</filter-name> <filter-...
URLRewrite配置和使用 URLRewrite是一种URL重写技术,它可以满足搜索引擎的要求,隐藏技术实现,提高网站的移植性,并满足美感的要求。下面将详细介绍URLRewrite的配置和使用。 1. 满足搜索引擎的要求 搜索引擎对...
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class> </filter> <filter-mapping> <filter-name>UrlRewriteFilter</filter-name> <url-pattern>/*</url-pattern> </filter-...
UrlRewrite是一个强大的URL管理工具,常用于ASP.NET应用程序中,它允许开发者通过自定义规则对网站的URL进行重写和转换。这个技术的核心在于提供更友好的、搜索引擎优化(SEO)的URL,同时也可以帮助解决网站迁移或...
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class> <param-name>logLevel <param-value>info </filter> <filter-mapping> <filter-name>UrlRewriteFilter</filter-name> ...
什么是UrlRewrite UrlRewrite 是 将动态页面转换为静态页面的一种技术 例如 您网站页面是 http: www yourdomain com news docread aspx id 123 为什么使用UrlRewrite: 1 处理这样的情形:你要更改你的web应用...
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class> <!-- 设置自动更新urlrewrite.xml信息 --> <param-name>confReloadCheckInterval <param-value>60 </filter> <filter-...
urlrewrite 只支持单个配置文件,默认的配置文件为:/WEB-INF/urlrewrite.xml 现在对urlrewrite-3.2的源码进行了修改,使它能够支持多文件和通配符的形式加载自定义配置文件,即可以进行如下的配置: <param-name>...
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class> </filter> <filter-mapping> <filter-name>UrlRewriteFilter</filter-name> <url-pattern>/*</url-pattern> <dispatcher>...
在网上找了很多都不合心意,就知道改了下源码,只改了org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.class 文件,如果担心安全的朋友,可以下载 4.0.3的jar 替换UrlRewriteFilter.class即可。 confPath 默认 ...