urlrewrite重写/隐藏你的链接
Url Rewrite Filter
Home - java.net Project - Download & Install - urlrewrite google group - Manual
Based on the popular and very useful mod_rewrite for apache, UrlRewriteFilter is a Java Web Filter for any J2EE compliant web application server (such as Resin, Orion or Tomcat), which allows you to rewrite URLs before they get to your code. It is a very powerful tool just like Apache's mod_rewrite.
URL rewriting is very common with Apache Web Server (see mod_rewrite's rewriting guide) but has not been possible in most java web application servers. The main things it is used for are:
URL Tidyness / URL Abstraction - keep URLs tidy irrespective of the underlying technology or framework (JSP, Servlet, Struts etc).
Browser Detection - Allows you to rewrite URLs based on request HTTP headers (such as user-agent or charset).
Date based rewriting - Allows you to forward or redirect to other URL's based on the date/time (good for planned outages).
Moved content - enable a graceful move of content or even a change in CMS.
Tiny/Friendly URL's (i.e. blah.com/latest can be redirected to blah.com/download/ver1.2.46.2/setup.exe)
A Servlet mapping engine (see Method Invocation)
UrlRewriteFilter uses an xml file, called urlrewrite.xml (lives in the WEB-INF directory), for configuration. Most parameters can be Perl5 style Regular Expressions. This makes it very powerful indeed.
在Tomcat5.0以及以后版本中对中文的支持:
1,修改UrlRewriter.java,注销代码
// addition as suggested by Connor Barry//
try {
// originalUrl = URLDecoder.decode(originalUrl, "utf-8");
// if (log.isDebugEnabled()) {
// log.debug("after utf-8 decoding " + originalUrl);
// }
// } catch (java.io.UnsupportedEncodingException e) {
// log.warn("the jvm doesn't seem to support decoding utf-8, matches may not occur correctly.");
// return null;
// }
// end addition2,
修改UrlRewriteFilter.java,
增加代码:
hsRequest.setCharacterEncoding( "GBK" ) ;
或者
hsRequest.setCharacterEncoding( "UTF-8" ) ;
星期三, 十一月 30, 2005
星期二, 十一月 29, 2005
用Putty通过代理服务器穿透防火墙
Putty V0.58 可以通过代理服务器连接外部网络(Internet或者内部其他局域网),穿透防火墙。
SSHProxy是一个简单而且有用的Socks4 Socks5代理服务器,可以通过SHTTP Proxy 实现二级代理
The SSH Proxy is full featured SOCKS Proxy written in Java.It supports both versions 4 and 5 of Socks protocol.Additional feature that I have implemented in SSH Proxy is the possibility to make TCP connections through an HTTP-SSL Tunnel.
SSH Proxy works in two modes:
Normal mode - works as normal SOCKS Proxy
TCP via SHTTP mode - Works as SOCKS Proxy but makes SOCKS TCP connections via HTTP-SSL Tunnel Proxy.
The TCP via SHTTP mode is very useful when user woks behind HTTP Proxy and hasn't any other acces to the Internet. In this case the user can run SSH Proxy on his/her machine, and configure it to use TCP connections via HTTP-SSL tunnels which are commonly supported by most proxies. This way he/she will be able to use other internet applications, eg. IRC, FTP, e-mail, telnet, HTTP (of course :-) but without caching and etc.
用Putty通过代理服务器穿透防火墙
SSHProxy是一个简单而且有用的Socks4 Socks5代理服务器,可以通过SHTTP Proxy 实现二级代理
The SSH Proxy is full featured SOCKS Proxy written in Java.It supports both versions 4 and 5 of Socks protocol.Additional feature that I have implemented in SSH Proxy is the possibility to make TCP connections through an HTTP-SSL Tunnel.
SSH Proxy works in two modes:
Normal mode - works as normal SOCKS Proxy
TCP via SHTTP mode - Works as SOCKS Proxy but makes SOCKS TCP connections via HTTP-SSL Tunnel Proxy.
The TCP via SHTTP mode is very useful when user woks behind HTTP Proxy and hasn't any other acces to the Internet. In this case the user can run SSH Proxy on his/her machine, and configure it to use TCP connections via HTTP-SSL tunnels which are commonly supported by most proxies. This way he/she will be able to use other internet applications, eg. IRC, FTP, e-mail, telnet, HTTP (of course :-) but without caching and etc.
用Putty通过代理服务器穿透防火墙
星期四, 十一月 24, 2005
订阅:
博文 (Atom)