urlwrite

UrlRewriteFilter是一款适用于J2EE应用服务器(如Resin、Orion或Tomcat)的Java Web过滤器,其功能类似于Apache的mod_rewrite,能够帮助开发者进行URL重写。它主要用于保持URL整洁、浏览器检测、日期依赖的重写、内容迁移及生成友好的短链接等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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 (it goes into the WEB-INF directory), for configuration. Most parameters can be Perl5 style Regular Expressions or Wildcard Expressions. This makes it very powerful indeed.
使用matlab批量下载网站上的文件-MatlabUrlDownloadToFile.m 前几天美国数学建模成绩出了,我们按照网址下载了自己的证书,另外想看看学校今年的获奖情况,由于学校的参赛队伍数众多,一个一个下载证书再统计显得麻烦,于是想自己用matlab开发一个小程序以实现同类型文件的批量下载。很多网站上有介绍使用Windows API 函数URLDownloadToFile,但是这个在VC上实现容易,要把它移植到matlab上还得使用MEX,有点麻烦了。这几天一直徘徊个大小网站,没有找到相关信息。最后还是自己使用lookfor找到需要的函UrlWrite,调用这个函数轻松搞定批量下载! 以下是代码: %使用matlab下载网站上的文件 %使用urlwrite函数下载网站上的文件 %特别适用于批量下载同类型的文件 % Created by longwen36 2011-4-16 %使用urlwrite实现批量下载 %以下载2011美赛数模证书为例 clc,clear; num = 11701:11710; URLs = cell); folder_filenames = cell); filenames = cell); for idx  = 1:length;     URLs{idx} = sprintf);     filenames{idx} = sprintf); end tic; for idx = 1:length;     fprintf;     [f, status] = urlwrite;     if status == 1;         fprintf;     else         fprintf;     end     end etime = toc; fprintf,etime); 复制代码 下载速度还挺快的,才发现,matlab功能确实很强大,函数很齐全。利用这个函数,加以改进,编写GUI,就可以做个简易的批量下载器了! 感兴趣的同仁可以试试!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值